From 5522be36a60e2c32ce569a461fffd4f4e4f5b14d Mon Sep 17 00:00:00 2001 From: hujiebin Date: Fri, 18 Aug 2023 14:05:12 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E5=8E=BB=E6=8E=89=E6=98=8E?= =?UTF-8?q?=E6=98=BE=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/model/group_m/room.go | 2 +- domain/model/user_m/user.go | 10 +++++----- domain/model/user_m/vip.go | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/domain/model/group_m/room.go b/domain/model/group_m/room.go index 24131ac..5b7d8a3 100644 --- a/domain/model/group_m/room.go +++ b/domain/model/group_m/room.go @@ -279,7 +279,7 @@ func RoomLivingExistsUserId(groupUid string) ([]uint64, error) { if err != nil { return nil, myerr.WrapErr(err) } - mylogrus.MyLog.Infof("group_room_living RoomLivingExistsUserId groupUserIdstrs:%v", groupUserIdstrs) + //mylogrus.MyLog.Infof("group_room_living RoomLivingExistsUserId groupUserIdstrs:%v", groupUserIdstrs) userIds := make([]uint64, 0, len(groupUserIdstrs)) for i, _ := range groupUserIdstrs { tempGroupUid, userId := analysisMemberStr(groupUserIdstrs[i]) diff --git a/domain/model/user_m/user.go b/domain/model/user_m/user.go index dcf65bc..40287a1 100644 --- a/domain/model/user_m/user.go +++ b/domain/model/user_m/user.go @@ -94,10 +94,7 @@ func GetUserMapByIds(model *domain.Model, userIds []mysql.ID) (map[mysql.ID]User } var rows []User start := 0 - for end <= len(userIds) { - if end > len(userIds) { - end = len(userIds) - } + for start < len(userIds) { tmp, err := GetUsersByIds(model, userIds[start:end]) if err != nil { return result, err @@ -106,7 +103,10 @@ func GetUserMapByIds(model *domain.Model, userIds []mysql.ID) (map[mysql.ID]User } start += 500 end += 500 - model.Log.Infof("GetUserMapByIds start:%v-end:%v", start, end) + if end > len(userIds) { + end = len(userIds) + } + //model.Log.Infof("GetUserMapByIds start:%v-end:%v", start, end) } for _, i := range rows { result[i.ID] = i diff --git a/domain/model/user_m/vip.go b/domain/model/user_m/vip.go index 5d3ed7a..f5643c9 100644 --- a/domain/model/user_m/vip.go +++ b/domain/model/user_m/vip.go @@ -2,7 +2,6 @@ package user_m import ( "git.hilo.cn/hilo-common/domain" - "git.hilo.cn/hilo-common/mylogrus" "git.hilo.cn/hilo-common/resource/mysql" "gorm.io/gorm" "gorm.io/gorm/clause" @@ -85,7 +84,7 @@ func BatchGetVips(userIds []uint64) (map[uint64]*int64, error) { } start += 500 end += 500 - mylogrus.MyLog.Infof("BatchGetVips start:%v-end:%v", start, end) + //mylogrus.MyLog.Infof("BatchGetVips start:%v-end:%v", start, end) } for _, i := range userIds { -- 2.22.0