From 08838bd679fb9b85b075380ae5cb6fb25646bd71 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 30 Mar 2023 15:34:04 +0800 Subject: [PATCH] test --- md/commission_parameter.go | 1 + rule/relate_commission.go | 1 - svc/get_plan_cfg.go | 5 ++++- svc/reward_commission.go | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/md/commission_parameter.go b/md/commission_parameter.go index 654b609..853dd66 100644 --- a/md/commission_parameter.go +++ b/md/commission_parameter.go @@ -19,6 +19,7 @@ type CommissionParam struct { GoodsCommission string `json:"goods_commission"` GoodsType string `json:"goods_type"` TikTokTeamCommission string `json:"tik_tok_team_commission"` + IsTikTokTeamOrder string `json:"is_tik_tok_team_order"` MinLevel int `json:"min_level"` } type CommissionFirstParam struct { diff --git a/rule/relate_commission.go b/rule/relate_commission.go index 3ad8b65..f8b7d53 100644 --- a/rule/relate_commission.go +++ b/rule/relate_commission.go @@ -277,7 +277,6 @@ func BatchGetCommissionByOrder(engine *xorm.Engine, dbName string, CommissionPar param.CommissionParam.OldPrice = param.CommissionParam.GoodsPrice } param.CommissionParam.Oid = param.Oid - profit, pvdFee, sysFee, subsidyFee, lvUser, err := svc.GetRewardCommission(engine, ¶m.CommissionParam, isShare, param.Uid, param.Provider, dbName, isAllLevelReturn, map[string]string{}, commArr, plan, commission, virtualCoinMoneyRate) if err != nil { return err diff --git a/svc/get_plan_cfg.go b/svc/get_plan_cfg.go index 9b99b3b..e17b158 100644 --- a/svc/get_plan_cfg.go +++ b/svc/get_plan_cfg.go @@ -42,10 +42,13 @@ func GetAllPlan(eg *xorm.Engine, dbName string) (map[string]*model.PlanReward, m return plan, commission, virtualCoinMoneyRate } -func GetPlanCfg(eg *xorm.Engine, pvd, masterId string, rewardOpts map[string]*model.PlanReward, commissionOpts map[int]*model.PlanCommission, virtualCoinMoneyRate map[int]string) (*comm_plan.PlanOpt, error) { +func GetPlanCfg(eg *xorm.Engine, pvd, masterId string, rewardOpts map[string]*model.PlanReward, commissionOpts map[int]*model.PlanCommission, virtualCoinMoneyRate map[int]string, rmd *md.CommissionParam) (*comm_plan.PlanOpt, error) { opt := &comm_plan.PlanOpt{} // 根据供应商 rewardOpt := rewardOpts[pvd] + if pvd == "tikTok" && rmd.IsTikTokTeamOrder == "1" && rewardOpts["tikTokTeam"] != nil { + rewardOpt = rewardOpts["tikTokTeam"] + } if rewardOpt == nil { return nil, zhios_order_relate_logx.Warn("找不到方案记录") } diff --git a/svc/reward_commission.go b/svc/reward_commission.go index dcf5548..62b8884 100644 --- a/svc/reward_commission.go +++ b/svc/reward_commission.go @@ -65,7 +65,7 @@ func GetRewardCommission(engine *xorm.Engine, rmd *md.CommissionParam, isShare b level = zhios_order_relate_utils.StrToInt(extraData["show_level"]) } ownbuyReturnType := zhios_order_relate_utils.StrToInt(extraData["ownbuy_return_type"]) - cfg, err := GetPlanCfg(engine, newProvider, masterId, rewardOpts, commissionOpts, virtualCoinMoneyRate) + cfg, err := GetPlanCfg(engine, newProvider, masterId, rewardOpts, commissionOpts, virtualCoinMoneyRate, rmd) if err != nil { return 0, 0, 0, 0, nil, err }