Browse Source

更新

tags/v4.3.1
huangjiajun 1 year ago
parent
commit
aeaa9c0bba
4 changed files with 9 additions and 2 deletions
  1. +1
    -0
      db/model/plan_reward.go
  2. +1
    -0
      lib/comm_plan/init.go
  3. +1
    -0
      svc/get_plan_cfg.go
  4. +6
    -2
      svc/reward_commission.go

+ 1
- 0
db/model/plan_reward.go View File

@@ -20,4 +20,5 @@ type PlanReward struct {
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)"`
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)"`
}

+ 1
- 0
lib/comm_plan/init.go View File

@@ -20,6 +20,7 @@ type NiuBeiIntegralReleaseO2oRatio struct {
Key string `json:"key"`
}
type PlanOpt struct {
PointType int
IntegralOpen int
PlanCommissionId int
IsCanRunSubsidy int //用于后台判断要不要走补贴


+ 1
- 0
svc/get_plan_cfg.go View File

@@ -67,6 +67,7 @@ func GetPlanCfg(eg *xorm.Engine, pvd, masterId string, rewardOpts map[string]*mo
return nil, zhios_order_relate_logx.Warn("分佣模式不存在")
}
opt.Pvd = pvd
opt.PointType = rewardOpt.PointType
opt.Mode = commissionOpt.Mode
opt.IntegralOpen = rewardOpt.IntegralOpen
opt.SysRate = float64(int64(rewardOpt.SysRate*1e4)) / 1e4


+ 6
- 2
svc/reward_commission.go View File

@@ -479,8 +479,12 @@ 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)
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 // 供应商联盟比例
sysFee := fee * opt.SysRate // 平台比例


Loading…
Cancel
Save