Browse Source

test

master
huangjiajun 1 year ago
parent
commit
a2bf659e2a
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      hdl/hdl_upgrade.go

+ 5
- 5
hdl/hdl_upgrade.go View File

@@ -11,26 +11,26 @@ import (
"xorm.io/xorm" "xorm.io/xorm"
) )


func CommUpdate(blockStarChain string, eg *xorm.Engine, dbName string, user *model.User, DataDetail md.DataDetail) error {
func CommUpdate(blockStarChain string, eg *xorm.Engine, dbName string, user *model.User, DataDetail md.DataDetail) (error, bool) {
uid := DataDetail.Uid uid := DataDetail.Uid
//判断有没有审核通过或审核中的记录 //判断有没有审核通过或审核中的记录
has, err := db.UserLevelAuditingFindByUid(eg, zhios_condition_statistics_utils.StrToInt(uid)) has, err := db.UserLevelAuditingFindByUid(eg, zhios_condition_statistics_utils.StrToInt(uid))
if err != nil { if err != nil {
return err
return err, false
} }
if has != nil { if has != nil {
var msg = "您已审核通过,请勿重复申请" var msg = "您已审核通过,请勿重复申请"
if has.State == 1 { if has.State == 1 {
msg = "正在审核中,请稍后再查看" msg = "正在审核中,请稍后再查看"
} }
return errors.New(msg)
return errors.New(msg), false
} }
lv := user.Level lv := user.Level
result := CommUplv(blockStarChain, eg, dbName, user, lv, DataDetail) result := CommUplv(blockStarChain, eg, dbName, user, lv, DataDetail)
if result == false { if result == false {
return errors.New("升级失败")
return errors.New("升级失败"), false
} }
return nil
return nil, result
} }
func CommUplv(blockStarChain string, eg *xorm.Engine, dbName string, user *model.User, lv int, DataDetail md.DataDetail) bool { func CommUplv(blockStarChain string, eg *xorm.Engine, dbName string, user *model.User, lv int, DataDetail md.DataDetail) bool {
levelExpireAt := user.LevelExpireAt levelExpireAt := user.LevelExpireAt


Loading…
Cancel
Save