dengbiao 1 mese fa
parent
commit
fa0fc0ae78
2 ha cambiato i file con 10 aggiunte e 1 eliminazioni
  1. +9
    -0
      db/db_user_level.go
  2. +1
    -1
      rule/service_award_dividend/index.go

+ 9
- 0
db/db_user_level.go Vedi File

@@ -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)


+ 1
- 1
rule/service_award_dividend/index.go Vedi File

@@ -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
}


Caricamento…
Annulla
Salva