From f502e7b4b3d5ab28c56316e0ee735ce6448220e2 Mon Sep 17 00:00:00 2001 From: zhora Date: Sat, 11 Oct 2025 12:16:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E5=A4=A7=E6=AC=A1=E6=95=B0=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- call/config.go | 6 +++++- modules/web/handler/recharge.go | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/call/config.go b/call/config.go index 01c4e24..fc9a780 100644 --- a/call/config.go +++ b/call/config.go @@ -1469,7 +1469,7 @@ func GetConfigFirstPay() []*common.ConfigFirstPay { return configFirstPay } -func GetConfigFirstPayByCount(amount int64, buyCountMap map[string]int) (times int, per int64, topThree bool) { +func GetConfigFirstPayByCount(uid int, amount int64, buyCountMap map[string]int) (times int, per int64, topThree bool) { var buyCount int if buyCountMap != nil { //// todo 一个额度一个首充计算 @@ -1498,6 +1498,10 @@ func GetConfigFirstPayByCount(amount int64, buyCountMap map[string]int) (times i break } } + if buyCount < 20 { + topThree = true + } + //log.Debug("uid:%d rechargeCount:%d per:%d", uid, buyCount, per) return } diff --git a/modules/web/handler/recharge.go b/modules/web/handler/recharge.go index 28dfca1..624ba7c 100644 --- a/modules/web/handler/recharge.go +++ b/modules/web/handler/recharge.go @@ -50,7 +50,7 @@ func RechargeInfoFirst(c *gin.Context) { rechargeInfo := call.GetRechargeInfo(a.UID) for _, v := range call.GetConfigFirstPay() { var bonus int64 - _, per, _ := call.GetConfigFirstPayByCount(v.Amount, rechargeInfo.BuyAmountDataMap) + _, per, _ := call.GetConfigFirstPayByCount(a.UID, v.Amount, rechargeInfo.BuyAmountDataMap) if per > 0 { bonus = v.Amount * per / 100 } @@ -122,7 +122,7 @@ func RechargeInfo(c *gin.Context) { } } } - if _, bonus, _ := call.GetConfigFirstPayByCount(one.Amount, rechargeInfo.BuyAmountDataMap); bonus > 0 { + if _, bonus, _ := call.GetConfigFirstPayByCount(a.UID, one.Amount, rechargeInfo.BuyAmountDataMap); bonus > 0 { one.Bonus = bonus * one.Amount / 100 } resp.List = append(resp.List, one) @@ -338,7 +338,7 @@ func NewRechargeImp(req *values.RechargeReq, uid, cid int, ip string) *RechargeI //per := call.GetConfigFirstPayPerByAmount(notCharge, order.Amount) var times int if req.Bonus && req.ActivityID == 0 { - buyCount, per, topThree := call.GetConfigFirstPayByCount(order.Amount, re.BuyAmountDataMap) + buyCount, per, topThree := call.GetConfigFirstPayByCount(order.UID, order.Amount, re.BuyAmountDataMap) if per > 0 { order.Bonus = order.Amount * per / 100 }