diff --git a/svc/get_plan_cfg.go b/svc/get_plan_cfg.go index 2ba9ad5..e86df00 100644 --- a/svc/get_plan_cfg.go +++ b/svc/get_plan_cfg.go @@ -240,7 +240,31 @@ func PlanOpts(eg *xorm.Engine) map[string]*comm_plan.PlanOpt { if err != nil || allRewardPlan == nil { return nil } - + list, _ := db.SecondGetAllPriceTypeList(eg) + for _, v := range list { + var oneRewardPlan map[string]string + err := json.Unmarshal([]byte(v.CommissionData), &oneRewardPlan) + if err == nil { + var tmp = &model.PlanReward{ + Id: 0, + Pvd: "seFree_" + zhios_order_relate_utils.IntToStr(v.Id), + PvdRate: zhios_order_relate_utils.StrToFloat32(oneRewardPlan["pvd_rate"]) / 100, + SysRate: zhios_order_relate_utils.StrToFloat32(oneRewardPlan["sys_rate"]) / 100, + RegionRate: zhios_order_relate_utils.StrToFloat32(oneRewardPlan["region_rate"]) / 100, + GlobalRate: zhios_order_relate_utils.StrToFloat32(oneRewardPlan["global_rate"]) / 100, + SettleMode: zhios_order_relate_utils.StrToInt(oneRewardPlan["settle_mode"]), + PlanCommissionId: zhios_order_relate_utils.StrToInt(oneRewardPlan["plan_commission_id"]), + PlanSettleId: zhios_order_relate_utils.StrToInt(oneRewardPlan["plan_settle_id"]), + State: 1, + Source: 1, + IntegralOpen: zhios_order_relate_utils.StrToInt(oneRewardPlan["integral_open"]), + MerchantRate: zhios_order_relate_utils.StrToFloat32(oneRewardPlan["merchant_rate"]) / 100, + PushHandRate: zhios_order_relate_utils.StrToFloat32(oneRewardPlan["push_hand_rate"]) / 100, + OrderBeforeRate: zhios_order_relate_utils.StrToFloat32(oneRewardPlan["order_before_rate"]) / 100, + } + allRewardPlan = append(allRewardPlan, tmp) + } + } opts := map[string]*comm_plan.PlanOpt{} for _, v := range allRewardPlan { if _, ok := commissionPlans[v.PlanCommissionId]; ok && v.State == 1 && v.PlanCommissionId > 0 { @@ -265,6 +289,7 @@ func PlanOpts(eg *xorm.Engine) map[string]*comm_plan.PlanOpt { } } fmt.Println(opts) + if len(opts) == 0 { return nil }