|
|
@@ -46,12 +46,18 @@ func BatchGetPublicPlatoonRelateCommissionByOrder(engine *xorm.Engine, masterId |
|
|
|
if err != nil || commissionOpt == nil || commissionOpt.Id == 0 { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
var subsidyTmp map[string]*md.LvGrade |
|
|
|
if err := json.Unmarshal([]byte(commissionOpt.Data), &subsidyTmp); err != nil { |
|
|
|
var subsidyTmp = make(map[string]*md.LvGrade) |
|
|
|
var tmp map[string]*md.LvGrade |
|
|
|
if err := json.Unmarshal([]byte(commissionOpt.Data), &tmp); err != nil { |
|
|
|
return nil, zhios_order_relate_logx.Warn(fmt.Sprintf("%s:分佣方案数据设置错误", masterId)) |
|
|
|
} |
|
|
|
for _, v := range tmp { |
|
|
|
subsidyTmp[zhios_order_relate_utils.IntToStr(v.Lv)] = v |
|
|
|
} |
|
|
|
lvGrade := subsidyTmp[param.UserLevel] |
|
|
|
var selfRateList, commonWealthSystem, directPush map[string]string |
|
|
|
var directPush = make(map[string]string) |
|
|
|
var selfRateList = make(map[string]string) |
|
|
|
var commonWealthSystem = make(map[string]string) |
|
|
|
for _, coinId := range lvGrade.ReturnType { |
|
|
|
selfRateList[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.SelfRateList[coinId]) * zhios_order_relate_utils.StrToFloat64(param.PendingAmount) / 100) |
|
|
|
commonWealthSystem[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.CommonWealthSystem[coinId]) * zhios_order_relate_utils.StrToFloat64(param.PendingAmount) / 100) |
|
|
|