@@ -20,4 +20,5 @@ type PlanReward struct { | |||||
PushHandRate float32 `json:"push_hand_rate" xorm:"not null default 0.0000 comment('o2o推手抽成比例') FLOAT(6,4)"` | PushHandRate float32 `json:"push_hand_rate" xorm:"not null default 0.0000 comment('o2o推手抽成比例') FLOAT(6,4)"` | ||||
OrderBeforeRate float32 `json:"order_before_rate" xorm:"not null default 0.0000 comment('下单前的联盟抽成') FLOAT(6,4)"` | OrderBeforeRate float32 `json:"order_before_rate" xorm:"not null default 0.0000 comment('下单前的联盟抽成') FLOAT(6,4)"` | ||||
IntegralOpen int `json:"integral_open" xorm:"not null default 0 comment('积分抽成') TINYINT(1)"` | IntegralOpen int `json:"integral_open" xorm:"not null default 0 comment('积分抽成') TINYINT(1)"` | ||||
PointType int `json:"point_type" xorm:"not null default 0 comment('') TINYINT(1)"` | |||||
} | } |
@@ -20,6 +20,7 @@ type NiuBeiIntegralReleaseO2oRatio struct { | |||||
Key string `json:"key"` | Key string `json:"key"` | ||||
} | } | ||||
type PlanOpt struct { | type PlanOpt struct { | ||||
PointType int | |||||
IntegralOpen int | IntegralOpen int | ||||
PlanCommissionId int | PlanCommissionId int | ||||
IsCanRunSubsidy int //用于后台判断要不要走补贴 | IsCanRunSubsidy int //用于后台判断要不要走补贴 | ||||
@@ -67,6 +67,7 @@ func GetPlanCfg(eg *xorm.Engine, pvd, masterId string, rewardOpts map[string]*mo | |||||
return nil, zhios_order_relate_logx.Warn("分佣模式不存在") | return nil, zhios_order_relate_logx.Warn("分佣模式不存在") | ||||
} | } | ||||
opt.Pvd = pvd | opt.Pvd = pvd | ||||
opt.PointType = rewardOpt.PointType | |||||
opt.Mode = commissionOpt.Mode | opt.Mode = commissionOpt.Mode | ||||
opt.IntegralOpen = rewardOpt.IntegralOpen | opt.IntegralOpen = rewardOpt.IntegralOpen | ||||
opt.SysRate = float64(int64(rewardOpt.SysRate*1e4)) / 1e4 | opt.SysRate = float64(int64(rewardOpt.SysRate*1e4)) / 1e4 | ||||
@@ -479,8 +479,12 @@ func CommFee(fee float64, opt *comm_plan.PlanOpt, types, isGoods string) (float6 | |||||
if isGoods == "1" { | if isGoods == "1" { | ||||
orderBeforeRate := fee * opt.OrderBeforeRate | orderBeforeRate := fee * opt.OrderBeforeRate | ||||
fee1 := int64(fee*1e4) - int64(orderBeforeRate*1e4) | |||||
fee = float64(int64(float64(fee1)/100)) / 100 | |||||
if opt.PointType == 1 { //四舍五入 | |||||
fee = zhios_order_relate_utils.FloatFormat(orderBeforeRate, 2) | |||||
} else { | |||||
fee1 := int64(fee*1e4) - int64(orderBeforeRate*1e4) | |||||
fee = float64(int64(float64(fee1)/100)) / 100 | |||||
} | |||||
} | } | ||||
pvdFee := fee * opt.PvdRate // 供应商联盟比例 | pvdFee := fee * opt.PvdRate // 供应商联盟比例 | ||||
sysFee := fee * opt.SysRate // 平台比例 | sysFee := fee * opt.SysRate // 平台比例 | ||||