From f370d32fa4942367d2d494707aad1c2a2c2edde9 Mon Sep 17 00:00:00 2001 From: hujiebin Date: Thu, 31 Aug 2023 16:30:12 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9B=E6=BC=8F=E4=BA=86group=20by?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/cache/user_c/svip_vip_noble.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domain/cache/user_c/svip_vip_noble.go b/domain/cache/user_c/svip_vip_noble.go index 58bf95f..5c0f450 100644 --- a/domain/cache/user_c/svip_vip_noble.go +++ b/domain/cache/user_c/svip_vip_noble.go @@ -33,7 +33,7 @@ func LoadAllSvipVipNoble(model *domain.Model) { var nobles []UserLevel nobleMap := make(map[mysql.ID]uint16) if err := model.DB().Table("user_noble").Select("user_id,MAX(level) level"). - Where("level > 0 AND end_time > ?", time.Now()).Find(&nobles).Error; err != nil { + Where("level > 0 AND end_time > ?", time.Now()).Group("user_id").Find(&nobles).Error; err != nil { model.Log.Errorf("LoadAllNoble fail:%v", err) } else { for _, v := range nobles { -- 2.22.0