Browse Source

add reverse:for v1.3.4 公排制度集成

tags/v1.3.4
huangjiajun 2 years ago
parent
commit
cbdaef11a9
2 changed files with 13 additions and 4 deletions
  1. +4
    -1
      svc/get_plan_cfg.go
  2. +9
    -3
      svc/public_platoon_relate_commission.go

+ 4
- 1
svc/get_plan_cfg.go View File

@@ -61,7 +61,6 @@ func GetPlanCfg(eg *xorm.Engine, pvd, masterId string) (*comm_plan.PlanOpt, erro
opt.PushHandRate = float64(int64(rewardOpt.PushHandRate*1e4)) / 1e4
opt.MerchantRate = float64(int64(rewardOpt.MerchantRate*1e4)) / 1e4
opt.PlanCommissionId = rewardOpt.PlanCommissionId

// 兑换现金比例
virtualCoinMoneyRate, err := GetVirtualCoinMoneyRateList(eg, masterId)
if err != nil || virtualCoinMoneyRate == nil {
@@ -69,10 +68,14 @@ func GetPlanCfg(eg *xorm.Engine, pvd, masterId string) (*comm_plan.PlanOpt, erro
} else {
opt.VirtualCoinMoneyRatioList = virtualCoinMoneyRate
}
if commissionOpt.Mode == "public_platoon" { //公排
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 {
return nil, zhios_order_relate_logx.Warn("分佣方案数据设置总额不能大于1")
}

var subsidyTmp map[int]*comm_plan.LvGrade
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, "\"bili\":0", "\"bili\":\"0\"")
commissionOpt.Data = strings.ReplaceAll(commissionOpt.Data, "\"buy_deliver_list\":[]", "\"buy_deliver_list\":{}")


+ 9
- 3
svc/public_platoon_relate_commission.go View File

@@ -46,12 +46,18 @@ func BatchGetPublicPlatoonRelateCommissionByOrder(engine *xorm.Engine, masterId
if err != nil || commissionOpt == nil || commissionOpt.Id == 0 {
return nil, err
}
var subsidyTmp map[string]*md.LvGrade
if err := json.Unmarshal([]byte(commissionOpt.Data), &subsidyTmp); err != nil {
var subsidyTmp = make(map[string]*md.LvGrade)
var tmp map[string]*md.LvGrade
if err := json.Unmarshal([]byte(commissionOpt.Data), &tmp); err != nil {
return nil, zhios_order_relate_logx.Warn(fmt.Sprintf("%s:分佣方案数据设置错误", masterId))
}
for _, v := range tmp {
subsidyTmp[zhios_order_relate_utils.IntToStr(v.Lv)] = v
}
lvGrade := subsidyTmp[param.UserLevel]
var selfRateList, commonWealthSystem, directPush map[string]string
var directPush = make(map[string]string)
var selfRateList = make(map[string]string)
var commonWealthSystem = make(map[string]string)
for _, coinId := range lvGrade.ReturnType {
selfRateList[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.SelfRateList[coinId]) * zhios_order_relate_utils.StrToFloat64(param.PendingAmount) / 100)
commonWealthSystem[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.CommonWealthSystem[coinId]) * zhios_order_relate_utils.StrToFloat64(param.PendingAmount) / 100)


Loading…
Cancel
Save