|
|
@@ -34,6 +34,32 @@ func GetAllPlan(eg *xorm.Engine, dbName string) (map[string]*model.PlanReward, m |
|
|
|
for _, v := range pvds { |
|
|
|
plan[v.Pvd] = v |
|
|
|
} |
|
|
|
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, |
|
|
|
} |
|
|
|
plan[tmp.Pvd] = tmp |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
commission := make(map[int]*model.PlanCommission, 0) |
|
|
|
commissions := db.DbsPlanCommissionByIds(eg) |
|
|
|
for _, v := range commissions { |
|
|
|