From ed731678c3445e715884ad0ca100fc76b02941a2 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sat, 19 Nov 2022 10:54:16 +0800 Subject: [PATCH] =?UTF-8?q?add=20reverse:for=20v3.8.0=20=E6=8A=BD=E6=88=90?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- svc/reward_commission.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/svc/reward_commission.go b/svc/reward_commission.go index 2ce54cd..311108f 100644 --- a/svc/reward_commission.go +++ b/svc/reward_commission.go @@ -428,6 +428,11 @@ func CommFee(fee float64, opt *comm_plan.PlanOpt, types, isGoods string) (float6 if types == "integral" && opt.IntegralOpen == 0 || opt.Mode == "lv_winery" { //积分抽成后台没开启不用扣 return fee, 0, 0 } + if isGoods == "1" { + orderBeforeRate := fee * opt.OrderBeforeRate + fee1 := int64(fee*1e4) - int64(orderBeforeRate*1e4) + fee = float64(fee1) / 1e4 + } pvdFee := fee * opt.PvdRate // 供应商联盟比例 sysFee := fee * opt.SysRate // 平台比例 regionFee := fee * opt.RegionRate // 区域代理比例 @@ -435,11 +440,7 @@ func CommFee(fee float64, opt *comm_plan.PlanOpt, types, isGoods string) (float6 pushHandFee := fee * opt.PushHandRate merchantFee := fee * opt.MerchantRate newAgentFee := fee * opt.NewAgentRate - if isGoods == "1" { - orderBeforeRate := fee * opt.OrderBeforeRate - fee1 := int64(fee*1e4) - int64(orderBeforeRate*1e4) - fee = float64(fee1) / 1e4 - } + // 剩余可分配的佣金 total := int64(fee*1e4) - int64(pvdFee*1e4) - int64(sysFee*1e4) - int64(regionFee*1e4) - int64(globalFee*1e4) - int64(pushHandFee*1e4) - int64(merchantFee*1e4) - int64(newAgentFee*1e4)