瀏覽代碼

update

master
DengBiao 7 月之前
父節點
當前提交
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…
取消
儲存