From 3dff16b2e405fbcf3e2fed7fd59570d661a4f714 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 25 Apr 2024 00:04:20 +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 --- md/commission_parameter.go | 1 + svc/reward_commission.go | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/md/commission_parameter.go b/md/commission_parameter.go index 0aea15c..6328825 100644 --- a/md/commission_parameter.go +++ b/md/commission_parameter.go @@ -14,6 +14,7 @@ type CommissionParam struct { PaidPrice string `json:"paid_price"` Oid string `json:"oid"` //标记 IsGoods string `json:"is_goods"` + IsTask string `json:"is_task"` ShowLevel string `json:"show_level"` IsShowExtend string `json:"is_show_extend"` GoodsCommission string `json:"goods_commission"` diff --git a/svc/reward_commission.go b/svc/reward_commission.go index 402b823..8f3ce21 100644 --- a/svc/reward_commission.go +++ b/svc/reward_commission.go @@ -585,17 +585,17 @@ func CommFee(fee float64, opt *comm_plan.PlanOpt, types string, rmd *md.Commissi return fee, feeFirst, 0, 0 } isGoods := rmd.IsGoods - if isGoods == "1" { + if isGoods == "1" && rmd.IsTask != 1 { orderBeforeRate := fee * opt.OrderBeforeRate orderBeforeRateFirst := feeFirst * opt.OrderBeforeRate - fee1 := int64(fee*1e9) - int64(orderBeforeRate*1e9) - feeFirst1 := int64(feeFirst*1e9) - int64(orderBeforeRateFirst*1e9) + fee1 := int64(fee*1e4) - int64(orderBeforeRate*1e4) + feeFirst1 := int64(feeFirst*1e4) - int64(orderBeforeRateFirst*1e4) if opt.PointType == 1 { //四舍五入 - fee, _ = decimal.NewFromFloat(float64(fee1) / 1e9).Round(2).Float64() - feeFirst, _ = decimal.NewFromFloat(float64(feeFirst1) / 1e9).Round(2).Float64() + fee, _ = decimal.NewFromFloat(float64(fee1) / 10000).Round(2).Float64() + feeFirst, _ = decimal.NewFromFloat(float64(feeFirst1) / 10000).Round(2).Float64() } else { - fee = (float64(fee1) / 1e9) - feeFirst = (float64(feeFirst1) / 1e9) + fee = float64(int64(float64(fee1)/100)) / 100 + feeFirst = float64(int64(float64(feeFirst1)/100)) / 100 } } pvdFee := fee * opt.PvdRate // 供应商联盟比例 @@ -609,14 +609,14 @@ func CommFee(fee float64, opt *comm_plan.PlanOpt, types string, rmd *md.Commissi regionSubFee := fee * opt.RegionSubRate // 剩余可分配的佣金 - total := int64(fee*1e9) - int64(pvdFee*1e9) - int64(sysFee*1e9) - int64(regionFee*1e9) - int64(regionSubFee*1e9) - int64(globalFee*1e9) - int64(selfBuyGlobalFee*1e9) - int64(pushHandFee*1e9) - int64(merchantFee*1e9) - int64(newAgentFee*1e9) + total := int64(fee*1e4) - int64(pvdFee*1e4) - int64(sysFee*1e4) - int64(regionFee*1e4) - int64(regionSubFee*1e4) - int64(globalFee*1e4) - int64(selfBuyGlobalFee*1e4) - int64(pushHandFee*1e4) - int64(merchantFee*1e4) - int64(newAgentFee*1e4) for _, v := range opt.RateList { - total -= int64(fee * (v / 100) * 1e9) + total -= int64(fee * (v / 100) * 1e4) } if zhios_order_relate_utils.StrToFloat64(rmd.DouyinBili) > 0 { - total -= int64(zhios_order_relate_utils.StrToFloat64(rmd.DouyinBili) * 1e9) + total -= int64(zhios_order_relate_utils.StrToFloat64(rmd.DouyinBili) * 1e4) } - fee = float64(total) / 1e9 + fee = float64(total) / 1e4 if fee < 0 { fee = 0 } @@ -631,11 +631,11 @@ func CommFee(fee float64, opt *comm_plan.PlanOpt, types string, rmd *md.Commissi regionSubFeeFirst := feeFirst * opt.RegionSubRate // 剩余可分配的佣金 - totalFirst := int64(feeFirst*1e9) - int64(pvdFeeFirst*1e9) - int64(sysFeeFirst*1e9) - int64(regionFeeFirst*1e9) - int64(regionSubFeeFirst*1e9) - int64(globalFeeFirst*1e9) - int64(selfBuyGlobalFeeFirst*1e9) - int64(pushHandFeeFirst*1e9) - int64(merchantFeeFirst*1e9) - int64(newAgentFeeFirst*1e9) + totalFirst := int64(feeFirst*1e4) - int64(pvdFeeFirst*1e4) - int64(sysFeeFirst*1e4) - int64(regionFeeFirst*1e4) - int64(regionSubFeeFirst*1e4) - int64(globalFeeFirst*1e4) - int64(selfBuyGlobalFeeFirst*1e4) - int64(pushHandFeeFirst*1e4) - int64(merchantFeeFirst*1e4) - int64(newAgentFeeFirst*1e4) for _, v := range opt.RateList { - totalFirst -= int64(feeFirst * (v / 100) * 1e9) + totalFirst -= int64(feeFirst * (v / 100) * 1e4) } - feeFirst = float64(totalFirst) / 1e9 + feeFirst = float64(totalFirst) / 1e4 if feeFirst < 0 { feeFirst = 0 //