diff --git a/call/config.go b/call/config.go index 10bdcac..594dc9c 100644 --- a/call/config.go +++ b/call/config.go @@ -242,7 +242,7 @@ func GetConfigRWPerByRecharge(recharge int64, t int) int64 { } // CanAutoWithdraw 是否可自动退出 -func CanAutoWithdraw(uid int, recharge, withdraw int64) bool { +func CanAutoWithdraw(uid int, recharge, withdraw, withdrawNow int64) bool { if !config.GetBase().Release { return false } @@ -251,11 +251,11 @@ func CanAutoWithdraw(uid int, recharge, withdraw int64) bool { t = common.RWPerTypeFirst } per := GetConfigRWPerByRecharge(recharge, t) - log.Debug("uid:%d,per:%d,recharge:%d,withdraw:%d", uid, per, recharge, withdraw) + log.Debug("uid:%d,per:%d,recharge:%d,withdraw:%d,withdrawNow:%d", uid, per, recharge, withdraw, withdrawNow) if per == 0 { return false } - return recharge*per >= withdraw*100 + return recharge*per >= (withdraw+withdrawNow)*100 } // LoadConfigActivity 加载活动总配置表 diff --git a/common/config.go b/common/config.go index 1ea1631..d72c4a9 100644 --- a/common/config.go +++ b/common/config.go @@ -256,6 +256,7 @@ type ConfigRWPer struct { Up int64 `gorm:"column:up;type:bigint(20);default:0;comment:充值范围上限" json:"Up" web:"up"` Per int64 `gorm:"column:per;type:int(11);default:10;comment:充提比" json:"Per" web:"per"` Type int `gorm:"column:type;type:int(11);default:1;comment:类型 1首次 2非首次" json:"Type" web:"type"` + UpdatedBase } func (c *ConfigRWPer) TableName() string { diff --git a/modules/web/handler/withdraw.go b/modules/web/handler/withdraw.go index e1f9762..22f6a12 100644 --- a/modules/web/handler/withdraw.go +++ b/modules/web/handler/withdraw.go @@ -379,7 +379,7 @@ func PlayerWithdrawBlock(c *gin.Context) { } // 直接发起退出 - shouldAuto := call.CanAutoWithdraw(uid, re.TotalRecharge, re.TotalWithdraw+re.TotalWithdrawing+need) + shouldAuto := call.CanAutoWithdraw(uid, re.TotalRecharge, re.TotalWithdraw+re.TotalWithdrawing, need) // 第二步,创建订单 orderStatus := common.StatusROrderCreate if shouldAuto { @@ -535,7 +535,7 @@ func PlayerWithdraw(c *gin.Context) { // 在总赠送比配置比例小时才判断个人 // if call.GetTotalRechargePer(realAmount) < config.GetConfig().Web.TotalWithdrawPer { // 直接发起退出 - shouldAuto = call.CanAutoWithdraw(uid, re.TotalRecharge, re.TotalWithdraw+re.TotalWithdrawing+realAmount) + shouldAuto = call.CanAutoWithdraw(uid, re.TotalRecharge, re.TotalWithdraw+re.TotalWithdrawing, realAmount) // } // 第二步,创建订单 withdrawChannel := -1