浏览代码

test

tags/v4.3.1
huangjiajun 1年前
父节点
当前提交
ba7e56f3d0
共有 1 个文件被更改,包括 22 次插入0 次删除
  1. +22
    -0
      svc/reward_commission.go

+ 22
- 0
svc/reward_commission.go 查看文件

@@ -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
}



正在加载...
取消
保存