From cbdaef11a92dece48c7133f8641187ced273c586 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 12 Jul 2022 20:26:02 +0800 Subject: [PATCH] =?UTF-8?q?add=20reverse:for=20v1.3.4=20=E5=85=AC=E6=8E=92?= =?UTF-8?q?=E5=88=B6=E5=BA=A6=E9=9B=86=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- svc/get_plan_cfg.go | 5 ++++- svc/public_platoon_relate_commission.go | 12 +++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/svc/get_plan_cfg.go b/svc/get_plan_cfg.go index 874c59c..bf33ff0 100644 --- a/svc/get_plan_cfg.go +++ b/svc/get_plan_cfg.go @@ -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\":{}") diff --git a/svc/public_platoon_relate_commission.go b/svc/public_platoon_relate_commission.go index 2bc0e20..9a80170 100644 --- a/svc/public_platoon_relate_commission.go +++ b/svc/public_platoon_relate_commission.go @@ -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)