From ae0ff85715cf841571be34e776ef5184702e9f15 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 17 Nov 2022 14:57:04 +0800 Subject: [PATCH] =?UTF-8?q?add=20reverse:for=20v3.7.6=20=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- svc/extend_price_reward.go | 31 ++++++++++--------- svc/public_platoon_relate_commission.go | 16 +++++----- svc/reward_commission.go | 16 +++++----- svc/small_public_platoon_relate_commission.go | 20 +++++++----- 4 files changed, 47 insertions(+), 36 deletions(-) diff --git a/svc/extend_price_reward.go b/svc/extend_price_reward.go index f923da1..23096be 100644 --- a/svc/extend_price_reward.go +++ b/svc/extend_price_reward.go @@ -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 diff --git a/svc/public_platoon_relate_commission.go b/svc/public_platoon_relate_commission.go index 6661d8c..fc1de56 100644 --- a/svc/public_platoon_relate_commission.go +++ b/svc/public_platoon_relate_commission.go @@ -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 diff --git a/svc/reward_commission.go b/svc/reward_commission.go index 5f4be39..ac059ea 100644 --- a/svc/reward_commission.go +++ b/svc/reward_commission.go @@ -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, diff --git a/svc/small_public_platoon_relate_commission.go b/svc/small_public_platoon_relate_commission.go index bfac21e..62df700 100644 --- a/svc/small_public_platoon_relate_commission.go +++ b/svc/small_public_platoon_relate_commission.go @@ -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,