From 7ddc4afdf58c96b79599c48600ed6fb6ce729c20 Mon Sep 17 00:00:00 2001 From: zhora Date: Wed, 29 Oct 2025 10:28:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9vip0=E6=8F=90=E7=8E=B0?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/web/app/balance.go | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/modules/web/app/balance.go b/modules/web/app/balance.go index 1259f0c..c46d4b2 100644 --- a/modules/web/app/balance.go +++ b/modules/web/app/balance.go @@ -25,8 +25,13 @@ func (g *Gin) CheckWithdrawCondition(amount int64, t common.CurrencyType) (ok bo g.Msg = "You have not completed the required bets yet. Before making an extraction it should be done." return } + con := call.GetVipCon(g.UID) + if con == nil { + g.Code = values.CodeWithdrawCondition + return + } vip := call.GetVIP(g.UID) - if vip.Level == 0 { + if vip.Level == 0 && con.WithdrawCount == 0 { var limit int64 = 20 if con := call.GetConfigVIPByLevel(1); con != nil { limit = con.Exp / common.DecimalDigits @@ -36,20 +41,27 @@ func (g *Gin) CheckWithdrawCondition(amount int64, t common.CurrencyType) (ok bo return } re := call.GetRechargeInfo(g.UID) - con := call.GetVipCon(g.UID) - if con == nil { - g.Code = values.CodeWithdrawCondition - return - } - if re.DayWithdraw+amount >= int64(con.WithdrawAmount) { + withdrawAmount := re.DayWithdraw + amount + withdrawCount := re.WithdrawCount + if con.Level == 0 { + withdrawAmount = re.TotalWithdraw + amount + withdrawCount = int(re.TotalWithdrawCount) + } + if withdrawAmount >= int64(con.WithdrawAmount) { g.Code = values.CodeWithdrawLimit - g.Msg = "Clearance amount has reached today!" + g.Msg = "Clearance amount has reached" + if vip.Level > 0 { + g.Msg += " today!" + } return } - if re.WithdrawCount >= con.WithdrawCount { + if withdrawCount >= con.WithdrawCount { g.Code = values.CodeWithdrawLimit - g.Msg = "Clearance count has reached today!" + g.Msg = "Clearance count has reached" + if vip.Level > 0 { + g.Msg += " today!" + } return }