From 4365e78656a1de5b28504bbab24fe2788079e578 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sat, 4 Mar 2023 15:16:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/comm_plan/all.go | 21 ++++++--------------- lib/comm_plan/init.go | 5 +++-- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/lib/comm_plan/all.go b/lib/comm_plan/all.go index 5b4cb0a..11ed35d 100644 --- a/lib/comm_plan/all.go +++ b/lib/comm_plan/all.go @@ -549,19 +549,9 @@ func subsidyFeeDo(opt *PlanOpt, totalAmt, integralTotalAmt float64, lvuser *LvUs if grade[lv] == nil { return subsidyFee, subsidyRatio, isOnlySubsidyFee, subsidyFeeList, subsidyRatioList } - if grade[lv].UserSubsidyType == "winery" { //酒庄模式 换一下计算基数 - commission := lvuser.Profit - amountList := lvuser.ProfitList - var baseMoney = commission - if zhios_order_relate_utils.StrToInt(grade[lv].UserSubsidyBaseCoinId) > 0 { - for _, v := range amountList { - if v.Cid == grade[lv].UserSubsidyBaseCoinId { - baseMoney = v.Val - } - } - } - totalAmt = baseMoney - integralTotalAmt = baseMoney + if grade[lv].UserSubsidyType == "winery" { //酒庄模式 结算再管 + totalAmt = 0 + integralTotalAmt = 0 } subsidyFee, subsidyRatio, isOnlySubsidyFee, subsidyFeeList, subsidyRatioList = commSubsidy(opt, totalAmt, integralTotalAmt, lvuser, newLv, pvd, sysFee, integralSysFee, grade) return subsidyFee, subsidyRatio, isOnlySubsidyFee, subsidyFeeList, subsidyRatioList @@ -660,8 +650,9 @@ func commSubsidy(opt *PlanOpt, totalAmt, integralTotalAmt float64, lvuser *LvUse } amount, subsidyRatio := GetSubsidyVirtualCoinAmount(ratio, moneyRate, modeStr, newAmt, newSysFee, subsidyMode) subsidyFeeList = append(subsidyFeeList, &VirtualCoinCommission{ - Cid: coinId, - Val: amount, + Cid: coinId, + Val: amount, + Bili: subsidyRatio, }) subsidyRatioList = append(subsidyRatioList, &VirtualCoinCommission{ Cid: coinId, diff --git a/lib/comm_plan/init.go b/lib/comm_plan/init.go index 8c1eb74..bb332cb 100644 --- a/lib/comm_plan/init.go +++ b/lib/comm_plan/init.go @@ -148,8 +148,9 @@ type LvUser struct { // 虚拟币分佣结构体 type VirtualCoinCommission struct { - Cid string `json:"cid"` // 虚拟币id - Val float64 `json:"val"` // 数量 + Cid string `json:"cid"` // 虚拟币id + Val float64 `json:"val"` // 数量 + Bili float64 `json:"bili"` } type VirtualCoinRateList struct {