diff --git a/domain/cache/user_c/svip_vip_noble.go b/domain/cache/user_c/svip_vip_noble.go index 58bf95f0e7ca7d9980906de1cf78c169d52a6044..5c0f450119a6d36b87fc5384707910013b1fe2c4 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 {