|
|
@@ -200,7 +200,7 @@ Loop: |
|
|
|
//新的团队奖 |
|
|
|
commission, _, amountList, teamRatioList := CalReturnAmountAndRatioWineryTeamNew(node.ParentUser.Lv, userList.OwnbuyReturnType, peerNum, "new_team", totalAmt, integralTotalAmt, opt) |
|
|
|
commission, restAmt, newTotalCommissionRatio, node.ParentUser.SubsidyFee, isBreak = teamDiffMoneyWineryNew(node.ParentUser.Profit, grade[node.Lv].PayMode, isOnlySubsidyFee, totalAmt, restAmt, grade[node.ParentUser.Lv].TeamRate, newTotalCommissionRatio, peerRate, node.ParentUser.SubsidyFee, subsidyRatio) |
|
|
|
amountList, restAmtList, newAccumulateRatioList, node.ParentUser.SubsidyFeeList, zeroList = teamDiffMoneyV2WineryNew(node.ParentUser.ProfitList, grade[node.Lv].PayMode, isOnlySubsidyFee, totalAmtList, restAmtList, teamRatioList, newAccumulateRatioList, peerRateList, subsidyFeeList, subsidyRatioList) |
|
|
|
amountList, restAmtList, newAccumulateRatioList, node.ParentUser.SubsidyFeeList, zeroList = teamDiffMoneyV2WineryNew(opt, node.ParentUser.ProfitList, grade[node.Lv].PayMode, isOnlySubsidyFee, totalAmtList, restAmtList, teamRatioList, newAccumulateRatioList, peerRateList, subsidyFeeList, subsidyRatioList) |
|
|
|
amountMap := make(map[string]float64) |
|
|
|
for _, v := range amountList { |
|
|
|
amountMap[v.Cid] = v.Val |
|
|
@@ -342,7 +342,30 @@ func teamDiffMoneyWineryNew(profit float64, payMode, isOnlySubsidy int, totalAmt |
|
|
|
} |
|
|
|
|
|
|
|
// 处理多虚拟币团队的 |
|
|
|
func teamDiffMoneyV2WineryNew(profitList []*VirtualCoinCommission, payMode, isOnlySubsidy int, totalAmtList, restAmtList, teamRatioList, totalRatioList, peerRateList, subsidyFeeList, subsidyRatioList []*VirtualCoinCommission) (newProfitList, newRestAmtList, newTotalRatioList, newSubsidyFeeList []*VirtualCoinCommission, zeroList map[string]struct{}) { |
|
|
|
func teamDiffMoneyV2WineryNew(opt *PlanOpt, profitList []*VirtualCoinCommission, payMode, isOnlySubsidy int, totalAmtList, restAmtList, teamRatioList, totalRatioList, peerRateList, subsidyFeeList, subsidyRatioList []*VirtualCoinCommission) (newProfitList, newRestAmtList, newTotalRatioList, newSubsidyFeeList []*VirtualCoinCommission, zeroList map[string]struct{}) { |
|
|
|
if len(profitList) == 0 { |
|
|
|
var returnType = make([]string, 0) |
|
|
|
var maxReturnTypeCount = 0 |
|
|
|
for _, v := range opt.UserRate { |
|
|
|
if v.ReturnType != nil { |
|
|
|
if len(v.ReturnType) > maxReturnTypeCount { |
|
|
|
maxReturnTypeCount = len(v.ReturnType) |
|
|
|
returnType = v.ReturnType |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 新版支持多种虚拟币 支持的种类id保存在ReturnType id=0代表现金佣金 其他为虚拟币 |
|
|
|
if returnType != nil { //返佣类型 |
|
|
|
for _, coinId := range returnType { |
|
|
|
profitList = append(profitList, &VirtualCoinCommission{ |
|
|
|
Cid: coinId, |
|
|
|
Val: 0, |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
restAmtMap := convertList2Map(restAmtList) |
|
|
|
totalAmtMap := convertList2Map(totalAmtList) |
|
|
|
profitMap := convertList2Map(profitList) |
|
|
@@ -355,6 +378,9 @@ func teamDiffMoneyV2WineryNew(profitList []*VirtualCoinCommission, payMode, isOn |
|
|
|
newProfitList = make([]*VirtualCoinCommission, 0) |
|
|
|
|
|
|
|
for _, coin := range profitList { |
|
|
|
if teamRatioMap[coin.Cid] == 0 { |
|
|
|
continue |
|
|
|
} |
|
|
|
// 如果是团队内部支出团队比例大于同级累计比例 或站长支出 |
|
|
|
teamRatioMap[coin.Cid] = zhios_order_relate_utils.FloatFormat(teamRatioMap[coin.Cid]-totalRatioMap[coin.Cid], 6) |
|
|
|
|
|
|
|