DengBiao пре 9 месеци
родитељ
комит
cc06bfddb9
1 измењених фајлова са 16 додато и 2 уклоњено
  1. +16
    -2
      rule/green_coin_double_chain_settlement.go

+ 16
- 2
rule/green_coin_double_chain_settlement.go Прегледај датотеку

@@ -83,12 +83,26 @@ func DealUserGreenCoinDoubleChainIntegral(Db *xorm.Engine, uid int, amount, ordI
}
var sonUserIds []int
for _, v := range *sonUserRelates {
sonUserIds = append(sonUserIds, v.Uid)
if v.Uid != uid {
sonUserIds = append(sonUserIds, v.Uid)
}
}

users, err := db.DbsUserFindByIds(Db, sonUserIds)
if err != nil {
return
}
var userIds []int
for _, v := range *users {
if v.Level >= 2 {
//TODO::暂时写死(至少是银卡会员等级才能兑换)
userIds = append(userIds, v.Uid)
}
}

//5、查询上级直推的所有下级用户的虚拟币金额是否有大于当前用户的
var sonUserVirtualWallet model.UserVirtualAmount
isHas, err := session.Where(" coin_id = ? and amount >=?", greenCoinDoubleChain.Coin2, amount).And("uid != ?", uid).In("uid", sonUserIds).Get(&sonUserVirtualWallet)
isHas, err := session.Where(" coin_id = ? and amount >=?", greenCoinDoubleChain.Coin2, amount).In("uid", userIds).Get(&sonUserVirtualWallet)
if err != nil {
return
}


Loading…
Откажи
Сачувај