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