|
@@ -60,7 +60,31 @@ func GetAllPlan(eg *xorm.Engine, dbName string) (map[string]*model.PlanReward, m |
|
|
plan[tmp.Pvd] = tmp |
|
|
plan[tmp.Pvd] = tmp |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
moreList, _ := db.MoreGetAllPriceTypeList(eg) |
|
|
|
|
|
for _, v := range moreList { |
|
|
|
|
|
var oneRewardPlan map[string]string |
|
|
|
|
|
err := json.Unmarshal([]byte(v.CommissionData), &oneRewardPlan) |
|
|
|
|
|
if err == nil { |
|
|
|
|
|
var tmp = &model.PlanReward{ |
|
|
|
|
|
Id: 0, |
|
|
|
|
|
Pvd: "moreFree_" + 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, |
|
|
|
|
|
} |
|
|
|
|
|
plan[tmp.Pvd] = tmp |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
commission := make(map[int]*model.PlanCommission, 0) |
|
|
commission := make(map[int]*model.PlanCommission, 0) |
|
|
commissions := db.DbsPlanCommissionByIds(eg) |
|
|
commissions := db.DbsPlanCommissionByIds(eg) |
|
|
for _, v := range commissions { |
|
|
for _, v := range commissions { |
|
@@ -271,6 +295,31 @@ func PlanOpts(eg *xorm.Engine) map[string]*comm_plan.PlanOpt { |
|
|
allRewardPlan = append(allRewardPlan, tmp) |
|
|
allRewardPlan = append(allRewardPlan, tmp) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
moreList, _ := db.MoreGetAllPriceTypeList(eg) |
|
|
|
|
|
for _, v := range moreList { |
|
|
|
|
|
var oneRewardPlan map[string]string |
|
|
|
|
|
err := json.Unmarshal([]byte(v.CommissionData), &oneRewardPlan) |
|
|
|
|
|
if err == nil { |
|
|
|
|
|
var tmp = &model.PlanReward{ |
|
|
|
|
|
Id: 0, |
|
|
|
|
|
Pvd: "moreFree_" + 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{} |
|
|
opts := map[string]*comm_plan.PlanOpt{} |
|
|
for _, v := range allRewardPlan { |
|
|
for _, v := range allRewardPlan { |
|
|
if _, ok := commissionPlans[v.PlanCommissionId]; ok && v.State == 1 && v.PlanCommissionId > 0 { |
|
|
if _, ok := commissionPlans[v.PlanCommissionId]; ok && v.State == 1 && v.PlanCommissionId > 0 { |
|
|