@@ -66,22 +66,25 @@ func ExtendPriceReward(eg *xorm.Engine, param map[string]string, cfg *comm_plan. | |||
isTrue = true | |||
} | |||
var extendReward = make(map[string]string) | |||
for _, coinId := range lvGrade.ReturnType { | |||
reward := rewardList[coinId] | |||
var pendingAmount = param["commission"] | |||
if zhios_order_relate_utils.StrToInt(coinId) > 0 { //积分更换基数 | |||
pendingAmount = param["integral"] | |||
} | |||
rewardAmount := reward.Bili | |||
//如果等级一致 判断位置 | |||
if isTrue && zhios_order_relate_utils.StrToInt(reward.BaseVal) > 0 { | |||
position := count % zhios_order_relate_utils.StrToInt64(reward.BaseVal) | |||
if position == 0 { | |||
rewardAmount = reward.PositionBili | |||
if lvGrade != nil { | |||
for _, coinId := range lvGrade.ReturnType { | |||
reward := rewardList[coinId] | |||
var pendingAmount = param["commission"] | |||
if zhios_order_relate_utils.StrToInt(coinId) > 0 { //积分更换基数 | |||
pendingAmount = param["integral"] | |||
} | |||
rewardAmount := reward.Bili | |||
//如果等级一致 判断位置 | |||
if isTrue && zhios_order_relate_utils.StrToInt(reward.BaseVal) > 0 { | |||
position := count % zhios_order_relate_utils.StrToInt64(reward.BaseVal) | |||
if position == 0 { | |||
rewardAmount = reward.PositionBili | |||
} | |||
} | |||
} | |||
extendReward[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(rewardAmount) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) | |||
extendReward[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(rewardAmount) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) | |||
} | |||
} | |||
return extendReward, userProfile.ParentUid | |||
@@ -57,14 +57,16 @@ func BatchGetPublicPlatoonRelateCommissionByOrder(engine *xorm.Engine, masterId | |||
var directPush = make(map[string]string) | |||
var selfRateList = make(map[string]string) | |||
var commonWealthSystem = make(map[string]string) | |||
for _, coinId := range lvGrade.ReturnType { | |||
var pendingAmount = param.PendingAmount | |||
if zhios_order_relate_utils.StrToInt(coinId) > 0 { //积分更换基数 | |||
pendingAmount = param.PendingIntegral | |||
if lvGrade != nil { | |||
for _, coinId := range lvGrade.ReturnType { | |||
var pendingAmount = param.PendingAmount | |||
if zhios_order_relate_utils.StrToInt(coinId) > 0 { //积分更换基数 | |||
pendingAmount = param.PendingIntegral | |||
} | |||
selfRateList[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.SelfRateList[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) | |||
commonWealthSystem[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.CommonWealthSystem[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) | |||
directPush[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.DirectPush[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) | |||
} | |||
selfRateList[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.SelfRateList[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) | |||
commonWealthSystem[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.CommonWealthSystem[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) | |||
directPush[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.DirectPush[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) | |||
} | |||
//TODO::本次消费产生的共富收益给到谁 | |||
var nowBenefitUid string | |||
@@ -627,14 +627,16 @@ func BatchGetPublicPlatoonRelateCommissionByGoods(engine *xorm.Engine, masterId | |||
var directPush = make(map[string]string) | |||
var selfRateList = make(map[string]string) | |||
var commonWealthSystem = make(map[string]string) | |||
for _, coinId := range lvGrade.ReturnType { | |||
var pendingAmount = param.PendingAmount | |||
if zhios_order_relate_utils.StrToInt(coinId) > 0 { //积分更换基数 | |||
pendingAmount = param.PendingIntegral | |||
if lvGrade != nil { | |||
for _, coinId := range lvGrade.ReturnType { | |||
var pendingAmount = param.PendingAmount | |||
if zhios_order_relate_utils.StrToInt(coinId) > 0 { //积分更换基数 | |||
pendingAmount = param.PendingIntegral | |||
} | |||
selfRateList[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.SelfRateList[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) | |||
commonWealthSystem[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.CommonWealthSystem[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) | |||
directPush[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.DirectPush[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) | |||
} | |||
selfRateList[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.SelfRateList[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) | |||
commonWealthSystem[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.CommonWealthSystem[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) | |||
directPush[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.DirectPush[coinId]) * zhios_order_relate_utils.StrToFloat64(pendingAmount) / 100) | |||
} | |||
resp[param.Oid] = &md.PublicPlatoonRelateCommissionResp{ | |||
Uid: param.Uid, | |||
@@ -50,10 +50,12 @@ func BatchSmallGetPublicPlatoonRelateCommission(engine *xorm.Engine, masterId st | |||
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) | |||
directPush[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.DirectPush[coinId]) * zhios_order_relate_utils.StrToFloat64(param.PendingAmount) / 100) | |||
if lvGrade != nil { | |||
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) | |||
directPush[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.DirectPush[coinId]) * zhios_order_relate_utils.StrToFloat64(param.PendingAmount) / 100) | |||
} | |||
} | |||
//TODO::本次消费产生的共富收益给到谁 | |||
@@ -177,10 +179,12 @@ func BatchSmallGetPublicPlatoonRelateByGoods(engine *xorm.Engine, masterId strin | |||
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) | |||
directPush[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.DirectPush[coinId]) * zhios_order_relate_utils.StrToFloat64(param.PendingAmount) / 100) | |||
if lvGrade != nil { | |||
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) | |||
directPush[coinId] = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(lvGrade.DirectPush[coinId]) * zhios_order_relate_utils.StrToFloat64(param.PendingAmount) / 100) | |||
} | |||
} | |||
resp[param.Oid] = &md.SmallPublicPlatoonRelateCommissionResp{ | |||
PendingAmount: param.PendingAmount, | |||