Ver a proveniência

update 绿色双链积分

master
DengBiao há 9 meses
ascendente
cometimento
46cde736ec
2 ficheiros alterados com 18 adições e 0 eliminações
  1. +9
    -0
      db/dbs_user.go
  2. +9
    -0
      rule/green_coin_double_chain_settlement.go

+ 9
- 0
db/dbs_user.go Ver ficheiro

@@ -17,6 +17,15 @@ func DbsUserFindByIds(eg *xorm.Engine, uid []int) (*[]model.User, error) {
return &users, nil
}

func DbsUserFindByUid(eg *xorm.Engine, uid int) (*model.User, error) {
var data model.User
get, err := eg.Where("uid =?", uid).Get(&data)
if get == false || err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
return &data, nil
}

func DbsUserRelate(eg *xorm.Engine, uid, level int) (*[]model.UserRelate, error) {
var userRelate []model.UserRelate
sess := eg.Where("uid = ?", uid)


+ 9
- 0
rule/green_coin_double_chain_settlement.go Ver ficheiro

@@ -24,6 +24,15 @@ func InitForGreenCoinDoubleChainIntegral(redisAddr string) (err error) {
}

func DealUserGreenCoinDoubleChainIntegral(Db *xorm.Engine, uid int, amount, ordId, masterId string) (isExchange bool, err error) {
user, err := db.DbsUserFindByUid(Db, uid)
if err != nil {
return
}
if user.Level >= 2 {
//TODO::暂时写死(至少是银卡会员等级才能兑换)
return
}

amountValue, _ := decimal.NewFromString(amount)
session := Db.NewSession()
defer func() {


Carregando…
Cancelar
Guardar