@@ -132,7 +132,11 @@ func CalcAll(opt *PlanOpt, totalAmt, integralTotalAmt float64, userList *LvUser, | |||||
ratioListMap := convertList2Map(ratioList) | ratioListMap := convertList2Map(ratioList) | ||||
for k, v := range userList.ProfitList { | for k, v := range userList.ProfitList { | ||||
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val | |||||
if v.Cid == "0" { | |||||
userList.ProfitList[k].Val = v.Val | |||||
} else { | |||||
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val | |||||
} | |||||
} | } | ||||
// 各种币换算出总的额度 | // 各种币换算出总的额度 | ||||
totalAmtList := make([]*VirtualCoinCommission, 0) | totalAmtList := make([]*VirtualCoinCommission, 0) | ||||
@@ -219,7 +219,11 @@ func CalcDsCheck(opt *PlanOpt, totalAmt, integralTotalAmt float64, userList *LvU | |||||
ratioListMap := convertList2Map(ratioList) | ratioListMap := convertList2Map(ratioList) | ||||
for k, v := range userList.ProfitList { | for k, v := range userList.ProfitList { | ||||
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val | |||||
if v.Cid == "0" { | |||||
userList.ProfitList[k].Val = v.Val | |||||
} else { | |||||
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val | |||||
} | |||||
} | } | ||||
userList.MinProfit = 0 | userList.MinProfit = 0 | ||||
userList.MinProfitList = make([]*VirtualCoinCommission, 0) | userList.MinProfitList = make([]*VirtualCoinCommission, 0) | ||||
@@ -22,7 +22,11 @@ func CalcOther(opt *PlanOpt, totalAmt, integralTotalAmt float64, userList *LvUse | |||||
ratioListMap := convertList2Map(ratioList) | ratioListMap := convertList2Map(ratioList) | ||||
for k, v := range userList.ProfitList { | for k, v := range userList.ProfitList { | ||||
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val | |||||
if v.Cid == "0" { | |||||
userList.ProfitList[k].Val = v.Val | |||||
} else { | |||||
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val | |||||
} | |||||
} | } | ||||
// 各种币换算出总的额度 | // 各种币换算出总的额度 | ||||
totalAmtList := make([]*VirtualCoinCommission, 0) | totalAmtList := make([]*VirtualCoinCommission, 0) | ||||
@@ -128,7 +132,7 @@ Loop: | |||||
return nil | return nil | ||||
} | } | ||||
//公共处理同级计算 (只计算佣金 旧版本用) | |||||
// 公共处理同级计算 (只计算佣金 旧版本用) | |||||
func otherSameMoney(lv, isOnlySubsidy int, restAmt, profit, peerRate, totalRatio, restRatio, subsidyFee, subsidyBili float64, opt *PlanOpt) (float64, float64, float64, float64, float64, bool) { | func otherSameMoney(lv, isOnlySubsidy int, restAmt, profit, peerRate, totalRatio, restRatio, subsidyFee, subsidyBili float64, opt *PlanOpt) (float64, float64, float64, float64, float64, bool) { | ||||
//如果不够扣了,并且是比例返利就跳过 | //如果不够扣了,并且是比例返利就跳过 | ||||
if restAmt < profit { | if restAmt < profit { | ||||
@@ -22,7 +22,11 @@ func CalcSelf(opt *PlanOpt, totalAmt float64, integralTotalAmt float64, userList | |||||
ratioListMap := convertList2Map(ratioList) | ratioListMap := convertList2Map(ratioList) | ||||
for k, v := range userList.ProfitList { | for k, v := range userList.ProfitList { | ||||
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val | |||||
if v.Cid == "0" { | |||||
userList.ProfitList[k].Val = v.Val | |||||
} else { | |||||
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val | |||||
} | |||||
} | } | ||||
// 各种币换算出总的额度 | // 各种币换算出总的额度 | ||||
totalAmtList := make([]*VirtualCoinCommission, 0) | totalAmtList := make([]*VirtualCoinCommission, 0) | ||||
@@ -23,7 +23,11 @@ func CalcWinery(opt *PlanOpt, totalAmt, integralTotalAmt float64, userList *LvUs | |||||
userList.SubsidyFee = 0 | userList.SubsidyFee = 0 | ||||
ratioListMap := convertList2Map(ratioList) | ratioListMap := convertList2Map(ratioList) | ||||
for k, v := range userList.ProfitList { | for k, v := range userList.ProfitList { | ||||
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val | |||||
if v.Cid == "0" { | |||||
userList.ProfitList[k].Val = v.Val | |||||
} else { | |||||
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val | |||||
} | |||||
} | } | ||||
maxLvData, _ := db.UserLevelByID(eg, "2") | maxLvData, _ := db.UserLevelByID(eg, "2") | ||||
// 各种币换算出总的额度 | // 各种币换算出总的额度 | ||||
@@ -718,7 +722,7 @@ func CalReturnAmountAndRatioExtendWinery(level, ownbuyReturnType, peerNum int, u | |||||
return commission, commissionRatio, amountList, ratioList | return commission, commissionRatio, amountList, ratioList | ||||
} | } | ||||
//公共处理下团队-上一层 (用于旧版的制度 只有佣金时) | |||||
// 公共处理下团队-上一层 (用于旧版的制度 只有佣金时) | |||||
func extendDiffMoney(profit float64, payMode, isOnlySubsidy int, totalAmt, restAmt, teamRatio, totalRatio, peerRate, subsidyFee, subsidyRatio float64) (float64, float64, float64, float64, bool) { | func extendDiffMoney(profit float64, payMode, isOnlySubsidy int, totalAmt, restAmt, teamRatio, totalRatio, peerRate, subsidyFee, subsidyRatio float64) (float64, float64, float64, float64, bool) { | ||||
//totalRatio += teamRatio | //totalRatio += teamRatio | ||||
//出现负数跳过 | //出现负数跳过 | ||||
@@ -117,7 +117,11 @@ func CalIntegralRelease(subsidyTmp map[string]*md.IntegralReleaseLvGrade, totalA | |||||
userList.ProfitList = amountList // 各币种分佣 | userList.ProfitList = amountList // 各币种分佣 | ||||
ratioListMap := convertList2Map(ratioList) | ratioListMap := convertList2Map(ratioList) | ||||
for k, v := range userList.ProfitList { | for k, v := range userList.ProfitList { | ||||
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val | |||||
if v.Cid == "0" { | |||||
userList.ProfitList[k].Val = v.Val | |||||
} else { | |||||
userList.ProfitList[k].Val = ratioListMap[v.Cid] * v.Val | |||||
} | |||||
} | } | ||||
// 各种币换算出总的额度 | // 各种币换算出总的额度 | ||||
totalAmtList := make([]*comm_plan.VirtualCoinCommission, 0) | totalAmtList := make([]*comm_plan.VirtualCoinCommission, 0) | ||||
@@ -174,7 +178,7 @@ func CalIntegralRelease(subsidyTmp map[string]*md.IntegralReleaseLvGrade, totalA | |||||
return nil | return nil | ||||
} | } | ||||
//佣金 积分 区块币计算 | |||||
// 佣金 积分 区块币计算 | |||||
func CalReturnAmountAndRatio(level, ownbuyReturnType int, userType string, fee, integralFee, integralFeeCom float64, subsidyTmp map[string]*md.IntegralReleaseLvGrade, commArr map[string]string, virtualCoinMoneyRatio map[int]string) (commission, commissionRatio float64, amountList, ratioList []*comm_plan.VirtualCoinCommission) { | func CalReturnAmountAndRatio(level, ownbuyReturnType int, userType string, fee, integralFee, integralFeeCom float64, subsidyTmp map[string]*md.IntegralReleaseLvGrade, commArr map[string]string, virtualCoinMoneyRatio map[int]string) (commission, commissionRatio float64, amountList, ratioList []*comm_plan.VirtualCoinCommission) { | ||||
lvGrade := subsidyTmp[zhios_order_relate_utils.IntToStr(level)] | lvGrade := subsidyTmp[zhios_order_relate_utils.IntToStr(level)] | ||||
if lvGrade == nil { | if lvGrade == nil { | ||||