|
|
@@ -89,6 +89,33 @@ func GetAllPlan(eg *xorm.Engine, dbName string) (map[string]*model.PlanReward, m |
|
|
|
plan[tmp.Pvd] = tmp |
|
|
|
} |
|
|
|
} |
|
|
|
fourList, _ := db.FourGetAllPriceTypeList(eg) |
|
|
|
for _, v := range fourList { |
|
|
|
var oneRewardPlan map[string]string |
|
|
|
err := json.Unmarshal([]byte(v.CommissionData), &oneRewardPlan) |
|
|
|
if err == nil { |
|
|
|
var tmp = &model.PlanReward{ |
|
|
|
Id: 0, |
|
|
|
Pvd: "fourFree_" + 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, |
|
|
|
StoreSubsidyRate: zhios_order_relate_utils.StrToFloat64(oneRewardPlan["store_subsidy_rate"]), |
|
|
|
RedPacketRate: zhios_order_relate_utils.StrToFloat64(oneRewardPlan["red_packet_rate"]), |
|
|
|
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 { |
|
|
|