From fca319958029fa924308e50cb61202d7d6ff5008 Mon Sep 17 00:00:00 2001 From: zhaoqingang <zhaoqg0118@163.com> Date: 星期三, 19 二月 2025 13:33:37 +0800 Subject: [PATCH] 暂停聚集模型 --- service/domain.go | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/service/domain.go b/service/domain.go index 851b054..def0191 100644 --- a/service/domain.go +++ b/service/domain.go @@ -78,3 +78,16 @@ return list, nil } + +func GetUnitsMapByIds(ids []string) (m map[string]*db.DomainUnit, err error) { + list := make([]*db.DomainUnit, 0) + err = db.GetDB().Model(&db.DomainUnit{}).Where("id in ?", ids).Find(&list).Error + if err != nil { + return nil, err + } + m = make(map[string]*db.DomainUnit, len(list)) + for _, v := range list { + m[v.ID] = v + } + return +} -- Gitblit v1.8.0