From 080a7fa6ba784a47240d865fdecb061f90a0190f Mon Sep 17 00:00:00 2001 From: mofangmin Date: Mon, 12 Aug 2024 09:58:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E5=85=85=E6=9B=B4=E6=94=B9=20?= =?UTF-8?q?=E6=94=BE=E5=BC=80=E5=A4=A7=E7=9B=98=E6=8F=90=E7=8E=B0=E6=8E=A7?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- call/pay.go | 10 ++++++++-- common/currency.go | 1 + modules/web/handler/withdraw.go | 8 ++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/call/pay.go b/call/pay.go index 58b49cf..b513193 100644 --- a/call/pay.go +++ b/call/pay.go @@ -249,9 +249,15 @@ func RechargeCallback(r *common.RechargeOrder, success bool, payAccount, extra s // if per > 0 { // bonus = amount * per / 100 // } - needBet := GetConfigCurrencyResourceNeedBet(common.CurrencyResourceRecharge, amount) + t := common.CurrencyResourceRecharge + if notCharge && bonus > 0 { // 首充 + t = common.CurrencyResourceFirstRecharge + } else if bonus > 0 { + t = common.CurrencyResourceRechargeBonus + } + needBet := GetConfigCurrencyResourceNeedBet(t, amount) if bonus > 0 { - needBet = GetConfigCurrencyResourceNeedBet(common.CurrencyResourceRechargeBonus, amount+bonus) + needBet = GetConfigCurrencyResourceNeedBet(t, amount+bonus) } cb := &common.CurrencyBalance{ UID: r.UID, diff --git a/common/currency.go b/common/currency.go index b8fb1e2..c99d194 100644 --- a/common/currency.go +++ b/common/currency.go @@ -27,6 +27,7 @@ const ( CurrencyResourceRecharge // 一般充值 CurrencyResourceBonus // 额外赠送 CurrencyResourceRechargeBonus // bonus充值 + CurrencyResourceFirstRecharge // 首充 CurrencyResourceAll ) diff --git a/modules/web/handler/withdraw.go b/modules/web/handler/withdraw.go index 1e84aeb..5161605 100644 --- a/modules/web/handler/withdraw.go +++ b/modules/web/handler/withdraw.go @@ -355,10 +355,10 @@ func PlayerWithdraw(c *gin.Context) { var shouldAuto = false // 在总赠送比配置比例小时才判断个人 - if call.GetTotalRechargePer(realAmount) < config.GetConfig().Web.TotalWithdrawPer { - // 直接发起退出 - shouldAuto = call.CanAutoWithdraw(uid, re.TotalRecharge, re.TotalWithdraw+re.TotalWithdrawing+realAmount) - } + // if call.GetTotalRechargePer(realAmount) < config.GetConfig().Web.TotalWithdrawPer { + // 直接发起退出 + shouldAuto = call.CanAutoWithdraw(uid, re.TotalRecharge, re.TotalWithdraw+re.TotalWithdrawing+realAmount) + // } // 第二步,创建订单 withdrawChannel := -1 if req.ChannelID != nil {