From 2c4d07fba758a96256865cc6788f842615e23b6e Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Mon, 25 Nov 2024 18:38:19 +0800 Subject: [PATCH] 1 --- lib/comm_plan/all.go | 6 +++++- lib/comm_plan/ds_check.go | 6 +++++- lib/comm_plan/other.go | 8 ++++++-- lib/comm_plan/self.go | 6 +++++- lib/comm_plan/winery.go | 8 ++++++-- svc/svc_integral_release.go | 8 ++++++-- 6 files changed, 33 insertions(+), 9 deletions(-) diff --git a/lib/comm_plan/all.go b/lib/comm_plan/all.go index 207c05f..d81078a 100644 --- a/lib/comm_plan/all.go +++ b/lib/comm_plan/all.go @@ -132,7 +132,11 @@ func CalcAll(opt *PlanOpt, totalAmt, integralTotalAmt float64, userList *LvUser, ratioListMap := convertList2Map(ratioList) 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) diff --git a/lib/comm_plan/ds_check.go b/lib/comm_plan/ds_check.go index da8730d..9c8f027 100644 --- a/lib/comm_plan/ds_check.go +++ b/lib/comm_plan/ds_check.go @@ -219,7 +219,11 @@ func CalcDsCheck(opt *PlanOpt, totalAmt, integralTotalAmt float64, userList *LvU ratioListMap := convertList2Map(ratioList) 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.MinProfitList = make([]*VirtualCoinCommission, 0) diff --git a/lib/comm_plan/other.go b/lib/comm_plan/other.go index ca8703d..ac21b7f 100644 --- a/lib/comm_plan/other.go +++ b/lib/comm_plan/other.go @@ -22,7 +22,11 @@ func CalcOther(opt *PlanOpt, totalAmt, integralTotalAmt float64, userList *LvUse ratioListMap := convertList2Map(ratioList) 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) @@ -128,7 +132,7 @@ Loop: return nil } -//公共处理同级计算 (只计算佣金 旧版本用) +// 公共处理同级计算 (只计算佣金 旧版本用) func otherSameMoney(lv, isOnlySubsidy int, restAmt, profit, peerRate, totalRatio, restRatio, subsidyFee, subsidyBili float64, opt *PlanOpt) (float64, float64, float64, float64, float64, bool) { //如果不够扣了,并且是比例返利就跳过 if restAmt < profit { diff --git a/lib/comm_plan/self.go b/lib/comm_plan/self.go index 5c7c278..d4ed41e 100644 --- a/lib/comm_plan/self.go +++ b/lib/comm_plan/self.go @@ -22,7 +22,11 @@ func CalcSelf(opt *PlanOpt, totalAmt float64, integralTotalAmt float64, userList ratioListMap := convertList2Map(ratioList) 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) diff --git a/lib/comm_plan/winery.go b/lib/comm_plan/winery.go index b45a82a..f915e1e 100644 --- a/lib/comm_plan/winery.go +++ b/lib/comm_plan/winery.go @@ -23,7 +23,11 @@ func CalcWinery(opt *PlanOpt, totalAmt, integralTotalAmt float64, userList *LvUs userList.SubsidyFee = 0 ratioListMap := convertList2Map(ratioList) 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") // 各种币换算出总的额度 @@ -718,7 +722,7 @@ func CalReturnAmountAndRatioExtendWinery(level, ownbuyReturnType, peerNum int, u 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) { //totalRatio += teamRatio //出现负数跳过 diff --git a/svc/svc_integral_release.go b/svc/svc_integral_release.go index a8a9908..0154d70 100644 --- a/svc/svc_integral_release.go +++ b/svc/svc_integral_release.go @@ -117,7 +117,11 @@ func CalIntegralRelease(subsidyTmp map[string]*md.IntegralReleaseLvGrade, totalA userList.ProfitList = amountList // 各币种分佣 ratioListMap := convertList2Map(ratioList) 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) @@ -174,7 +178,7 @@ func CalIntegralRelease(subsidyTmp map[string]*md.IntegralReleaseLvGrade, totalA 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) { lvGrade := subsidyTmp[zhios_order_relate_utils.IntToStr(level)] if lvGrade == nil {