修复充值比bug

dev_aagame_provider
zhora 1 month ago
parent b9d8c2a71c
commit 95dec7d157
  1. 6
      call/config.go
  2. 1
      common/config.go
  3. 4
      modules/web/handler/withdraw.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 加载活动总配置表

@ -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 {

@ -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

Loading…
Cancel
Save