Bladeren bron

test

tags/v4.3.1
huangjiajun 1 jaar geleden
bovenliggende
commit
ba7e56f3d0
1 gewijzigde bestanden met toevoegingen van 22 en 0 verwijderingen
  1. +22
    -0
      svc/reward_commission.go

+ 22
- 0
svc/reward_commission.go Bestand weergeven

@@ -481,10 +481,13 @@ func CommFee(fee float64, opt *comm_plan.PlanOpt, types, isGoods string) (float6
if isGoods == "1" {
orderBeforeRate := fee * opt.OrderBeforeRate
fee1 := int64(fee*1e4) - int64(orderBeforeRate*1e4)
feeFirst1 := int64(feeFirst*1e4) - int64(orderBeforeRate*1e4)
if opt.PointType == 1 { //四舍五入
fee, _ = decimal.NewFromFloat(float64(fee1) / 10000).Round(2).Float64()
feeFirst, _ = decimal.NewFromFloat(float64(feeFirst1) / 10000).Round(2).Float64()
} else {
fee = float64(int64(float64(fee1)/100)) / 100
feeFirst = float64(int64(float64(feeFirst1)/100)) / 100
}
}
pvdFee := fee * opt.PvdRate // 供应商联盟比例
@@ -504,6 +507,25 @@ func CommFee(fee float64, opt *comm_plan.PlanOpt, types, isGoods string) (float6
if fee < 0 {
fee = 0
}

pvdFeeFirst := feeFirst * opt.PvdRate // 供应商联盟比例
sysFeeFirst := feeFirst * opt.SysRate // 平台比例
regionFeeFirst := feeFirst * opt.RegionRate // 区域代理比例
globalFeeFirst := feeFirst * opt.GlobalRate // 全球分红比例
selfBuyGlobalFeeFirst := feeFirst * opt.SelfBuyGlobalRate // 全球分红比例
pushHandFeeFirst := feeFirst * opt.PushHandRate
merchantFeeFirst := feeFirst * opt.MerchantRate
newAgentFeeFirst := feeFirst * opt.NewAgentRate
regionSubFeeFirst := feeFirst * opt.RegionSubRate

// 剩余可分配的佣金
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)

feeFirst = float64(totalFirst) / 1e4
if feeFirst < 0 {
feeFirst = 0
}

return fee, feeFirst, pvdFee, sysFee
}



Laden…
Annuleren
Opslaan