@@ -19,6 +19,7 @@ type CommissionParam struct { | |||||
GoodsCommission string `json:"goods_commission"` | GoodsCommission string `json:"goods_commission"` | ||||
GoodsType string `json:"goods_type"` | GoodsType string `json:"goods_type"` | ||||
TikTokTeamCommission string `json:"tik_tok_team_commission"` | TikTokTeamCommission string `json:"tik_tok_team_commission"` | ||||
IsTikTokTeamOrder string `json:"is_tik_tok_team_order"` | |||||
MinLevel int `json:"min_level"` | MinLevel int `json:"min_level"` | ||||
} | } | ||||
type CommissionFirstParam struct { | type CommissionFirstParam struct { | ||||
@@ -277,7 +277,6 @@ func BatchGetCommissionByOrder(engine *xorm.Engine, dbName string, CommissionPar | |||||
param.CommissionParam.OldPrice = param.CommissionParam.GoodsPrice | param.CommissionParam.OldPrice = param.CommissionParam.GoodsPrice | ||||
} | } | ||||
param.CommissionParam.Oid = param.Oid | 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) | 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 { | if err != nil { | ||||
return err | return err | ||||
@@ -42,10 +42,13 @@ func GetAllPlan(eg *xorm.Engine, dbName string) (map[string]*model.PlanReward, m | |||||
return plan, commission, virtualCoinMoneyRate | 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{} | opt := &comm_plan.PlanOpt{} | ||||
// 根据供应商 | // 根据供应商 | ||||
rewardOpt := rewardOpts[pvd] | rewardOpt := rewardOpts[pvd] | ||||
if pvd == "tikTok" && rmd.IsTikTokTeamOrder == "1" && rewardOpts["tikTokTeam"] != nil { | |||||
rewardOpt = rewardOpts["tikTokTeam"] | |||||
} | |||||
if rewardOpt == nil { | if rewardOpt == nil { | ||||
return nil, zhios_order_relate_logx.Warn("找不到方案记录") | return nil, zhios_order_relate_logx.Warn("找不到方案记录") | ||||
} | } | ||||
@@ -65,7 +65,7 @@ func GetRewardCommission(engine *xorm.Engine, rmd *md.CommissionParam, isShare b | |||||
level = zhios_order_relate_utils.StrToInt(extraData["show_level"]) | level = zhios_order_relate_utils.StrToInt(extraData["show_level"]) | ||||
} | } | ||||
ownbuyReturnType := zhios_order_relate_utils.StrToInt(extraData["ownbuy_return_type"]) | 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 { | if err != nil { | ||||
return 0, 0, 0, 0, nil, err | return 0, 0, 0, 0, nil, err | ||||
} | } | ||||