From 3c033759200ad7c02dd59521b1aebbbdc35b98fa Mon Sep 17 00:00:00 2001 From: zhaoqingang <zhaoqg0118@163.com> Date: 星期六, 08 二月 2025 16:18:50 +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