diff --git a/svc/get_plan_cfg.go b/svc/get_plan_cfg.go index 8318632..d519c10 100644 --- a/svc/get_plan_cfg.go +++ b/svc/get_plan_cfg.go @@ -89,7 +89,7 @@ func GetPlanCfg(eg *xorm.Engine, pvd, masterId string, rewardOpts map[string]*mo return opt, nil } - if opt.SysRate >= 1 || opt.PvdRate >= 1 || opt.RegionRate >= 1 || opt.GlobalRate >= 1 || opt.PvdRate+opt.SysRate+opt.RegionRate+opt.GlobalRate >= 1 { + if opt.SysRate > 1 || opt.PvdRate > 1 || opt.RegionRate > 1 || opt.GlobalRate > 1 || opt.PvdRate+opt.SysRate+opt.RegionRate+opt.GlobalRate > 1 { return nil, zhios_order_relate_logx.Warn("分佣方案数据设置总额不能大于1") } diff --git a/svc/reward_commission.go b/svc/reward_commission.go index c418096..3e92d4c 100644 --- a/svc/reward_commission.go +++ b/svc/reward_commission.go @@ -493,6 +493,9 @@ func CommFee(fee float64, opt *comm_plan.PlanOpt, types, isGoods string) (float6 total := int64(fee*1e4) - int64(pvdFee*1e4) - int64(sysFee*1e4) - int64(regionFee*1e4) - int64(regionSubFee*1e4) - int64(globalFee*1e4) - int64(pushHandFee*1e4) - int64(merchantFee*1e4) - int64(newAgentFee*1e4) fee = float64(total) / 1e4 + if fee < 0 { + fee = 0 + } return fee, pvdFee, sysFee }