소스 검색

更新

tags/v4.3.0
huangjiajun 1 년 전
부모
커밋
61b6711946
1개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. +9
    -4
      lib/comm_plan/ds_check.go

+ 9
- 4
lib/comm_plan/ds_check.go 파일 보기

@@ -30,6 +30,7 @@ func CalReturnAmountAndRatioDsOwn(level, ownbuyReturnType, peerNum int, userType
amount := getCoinAmount(ratio, zhios_order_relate_utils.StrToInt(coinId), newFee, opt.VirtualCoinMoneyRatioList)
if coinId == "0" {
commission = amount
continue
}
amountList = append(amountList, &VirtualCoinCommission{
Cid: coinId,
@@ -108,7 +109,7 @@ func CalReturnAmountAndRatioDs(level, ownbuyReturnType, peerNum int, userType st
if coinId == "0" {
newFee = fee
}
ratio := getVirtualCoinRatio(userType, level, peerNum, opt.UserRate, coinId, 0)
ratio := getVirtualCoinRatioDsOwn(userType, level, peerNum, opt.UserRate, coinId, 0)
amount := getCoinAmount(ratio, zhios_order_relate_utils.StrToInt(coinId), newFee, opt.VirtualCoinMoneyRatioList)
if coinId == "0" { //
commission = amount
@@ -158,7 +159,7 @@ func CalReturnAmountAndRatioDsSecond(level, ownbuyReturnType, peerNum int, userT
if coinId == "0" {
newFee = node.Profit
}
ratio := getVirtualCoinRatio(userType, level, peerNum, opt.UserRate, coinId, 0)
ratio := getVirtualCoinRatioDsOwn(userType, level, peerNum, opt.UserRate, coinId, 0)
amount := getCoinAmount(ratio, zhios_order_relate_utils.StrToInt(coinId), newFee, opt.VirtualCoinMoneyRatioList)
if coinId == "0" { //
commission = amount
@@ -253,7 +254,7 @@ Loop:
if node.ParentUser.LevelWeight == maxLevelWeight && count > peerNum {
//如果设置了直推奖励 就拿前一个用户的佣金
//同级奖励比例 需要满足直推 X个以上同等级用户
if len(opt.UserRate[maxLv].SameUserCount) > peerNum {
if len(opt.UserRate[maxLv].PeerRateList) > peerNum {
userCount := opt.UserRate[maxLv].SameUserCount
sql := `SELECT COUNT(*) as count FROM user_profile up
LEFT JOIN user u on u.uid=up.uid
@@ -307,7 +308,11 @@ Loop:
commission, _, amountList, teamRatioList := CalReturnAmountAndRatioDsOwn(node.ParentUser.Lv, userList.OwnbuyReturnType, peerNum, "team", totalAmt, integralTotalAmt, opt)
//佣金
node.ParentUser.Profit = commission
node.ParentUser.Profit, restAmt, totalCommissionRatio, node.ParentUser.SubsidyFee, isBreak = teamDiffMoney(node.ParentUser.Profit, grade[node.Lv].PayMode, isOnlySubsidyFee, totalAmt, restAmt, grade[node.ParentUser.Lv].TeamRate, totalCommissionRatio, peerRate, node.ParentUser.SubsidyFee, 0)
teamRate := 0.00
if len(grade[node.ParentUser.Lv].TeamRateList) > 0 {
teamRate = zhios_order_relate_utils.StrToFloat64(grade[node.ParentUser.Lv].TeamRateList["0"])
}
node.ParentUser.Profit, restAmt, totalCommissionRatio, node.ParentUser.SubsidyFee, isBreak = teamDiffMoney(node.ParentUser.Profit, grade[node.Lv].PayMode, isOnlySubsidyFee, totalAmt, restAmt, teamRate, totalCommissionRatio, peerRate, node.ParentUser.SubsidyFee, 0)
//积分
node.ParentUser.ProfitList = amountList
// profitList []*VirtualCoinCommission, payMode, isOnlySubsidy int, totalAmtList, restAmtList, teamRatioList, totalRatioList, peerRateList, subsidyFeeList, subsidyRatioList []*VirtualCoinCommission


불러오는 중...
취소
저장