diff --git a/db/db_user_level.go b/db/db_user_level.go index 7b17df9..6a12a6c 100644 --- a/db/db_user_level.go +++ b/db/db_user_level.go @@ -17,6 +17,15 @@ func UserLevelInIDescByWeightLow(Db *xorm.Engine) ([]*model.UserLevel, error) { } +func UserLevelInIDescByWeightLowV1(Db *xorm.Engine) ([]*model.UserLevel, error) { + var ms []*model.UserLevel + if err := Db.Where("is_use=1").Asc("level_weight").Limit(100).Find(&ms); err != nil { + return nil, err + } + return ms, nil + +} + //UserLevelByID is 根据用户id 获取对应的等级信息 func UserLevelByID(Db *xorm.Engine, id interface{}) (*model.UserLevel, error) { m := new(model.UserLevel) diff --git a/rule/service_award_dividend/index.go b/rule/service_award_dividend/index.go index 9118ebd..683607a 100644 --- a/rule/service_award_dividend/index.go +++ b/rule/service_award_dividend/index.go @@ -56,7 +56,7 @@ func JoinServiceAwardDividendRelation(eg *xorm.Engine, req md.JoinServiceAwardDi return err } var levelMap = map[int]model.UserLevel{} - lvList, err := db.UserLevelInIDescByWeightLow(eg) + lvList, err := db.UserLevelInIDescByWeightLowV1(eg) for _, v := range lvList { levelMap[v.Id] = *v }