From fa0fc0ae78032e3abd023f61300e14de8aa3c5a4 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Fri, 13 Sep 2024 18:10:23 +0800 Subject: [PATCH] update --- db/db_user_level.go | 9 +++++++++ rule/service_award_dividend/index.go | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) 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 }