Commit f370d32f authored by hujiebin's avatar hujiebin

fix;漏了group by

parent 5b2e24f8
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment