From de14cc2db682f508c24955e9955aa5b1ce87f07e Mon Sep 17 00:00:00 2001 From: zhora Date: Thu, 18 Sep 2025 16:11:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=E5=8F=B0=E5=B1=95?= =?UTF-8?q?=E7=A4=BA,rtp=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- call/user.go | 29 +++++++++++++++++-- modules/backend/handler/examine/examine.go | 7 +++-- .../backend/handler/guser/getGameUserInfo.go | 2 +- modules/backend/values/examine.go | 10 ++++--- modules/backend/values/gameuser.go | 1 + 5 files changed, 39 insertions(+), 10 deletions(-) diff --git a/call/user.go b/call/user.go index 8dcc2c3..6f7701c 100644 --- a/call/user.go +++ b/call/user.go @@ -826,7 +826,7 @@ func GetRtpControl(uid int) int { return rtp } -func GetRtpControlV1(uid int) int { +func GetRtpControlV1(uid int, withdrawPer ...*int) int { rtp := 85 if v := GetConfigPlatform().Rtp; v > 0 { rtp = v @@ -850,10 +850,13 @@ func GetRtpControlV1(uid int) int { rtpControls := GetConfigRtpControl() var rtpControl, defaultRtpControl *common.ConfigRtpControl for _, v := range rtpControls { - if rechargeDay != v.RechargeDay && v.RechargeDay != -1 { + if v.RechargeDay == -1 { continue } - if v.WithdrawPer == -1 || v.RechargeDay == -1 { + if rechargeDay != v.RechargeDay { + continue + } + if v.WithdrawPer == -1 { defaultRtpControl = v } if int(withdrawRechargePer) < v.WithdrawPer { @@ -864,11 +867,31 @@ func GetRtpControlV1(uid int) int { if rtpControl == nil && defaultRtpControl != nil { rtpControl = defaultRtpControl } + if rtpControl == nil { + for _, v := range rtpControls { + if v.RechargeDay != -1 { + continue + } + if v.WithdrawPer == -1 { + defaultRtpControl = v + } + if int(withdrawRechargePer) < v.WithdrawPer { + rtpControl = v + break + } + } + if rtpControl == nil && defaultRtpControl != nil { + rtpControl = defaultRtpControl + } + } if rtpControl != nil { log.Debug("rtpControl, uid:%d totalWithdraw:%d withdrawing:%d cash:%d totalRecharge:%d withdrawPer:%d rechargeDay:%d | %+v", uid, rechargeInfo.TotalWithdraw, rechargeInfo.WithdrawingCash, cash, rechargeInfo.TotalRecharge, withdrawRechargePer, rechargeDay, *rtpControl) rtp = rtpControl.Rtp } + if len(withdrawPer) != 0 { + *(withdrawPer[0]) = int(withdrawRechargePer) + } return rtp } diff --git a/modules/backend/handler/examine/examine.go b/modules/backend/handler/examine/examine.go index b32a687..97ce3e7 100644 --- a/modules/backend/handler/examine/examine.go +++ b/modules/backend/handler/examine/examine.go @@ -31,7 +31,7 @@ func WithdrawList(c *gin.Context) { table1 := `(SELECT id,uid,channel_id,pay_channel,orderid,fail_reason,apipayid,payaccount,amount,create_time,callback_time,status,operator from withdraw_order %s)a` table2 := `(SELECT id,platform,mobile,tag from users %s)b` table3 := `(SELECT uid,inr from player_currency)c` - table4 := `(SELECT uid,total_recharge,total_recharge_count,total_withdraw,total_withdraw_count FROM recharge_info)d` + table4 := `(SELECT uid,total_recharge,total_recharge_count,total_withdraw,total_withdrawing,total_withdraw_count FROM recharge_info)d` // 表1的查询条件 table1Condition := fmt.Sprintf(" where event = %v and order_type = %d", common.CurrencyEventWithDraw, req.Type) @@ -78,7 +78,7 @@ func WithdrawList(c *gin.Context) { sqlCount := " SELECT COUNT(*) AS count from" sqlList := `SELECT a.id,a.uid,a.channel_id,a.pay_channel,a.orderid as OrderID,a.fail_reason as FailReason,a.apipayid as APIPayID,a.payaccount,a.amount,a.create_time,a.callback_time, - a.status,a.operator,b.platform,b.mobile,b.tag,c.inr,d.total_recharge,d.total_recharge_count,d.total_withdraw,d.total_withdraw_count from ` + a.status,a.operator,b.platform,b.mobile,b.tag,c.inr,d.total_recharge,d.total_recharge_count,d.total_withdraw,d.total_withdrawing,d.total_withdraw_count from ` querySql := fmt.Sprintf(table1, table1Condition) + " inner join " + fmt.Sprintf(table2, table2Condition) + " on a.uid = b.id inner join " + table3 + " on a.uid = c.uid inner join " + table4 + " on a.uid = d.uid " @@ -114,6 +114,9 @@ func WithdrawList(c *gin.Context) { for _, v := range withdrawChannels { payList[v.ChannelID] = call.GetWithdrawChannelName(v.ChannelID) } + for index, v := range WithdrawOrderArr { + WithdrawOrderArr[index].WithDrawPer = (v.Inr + v.TotalWithdraw + v.TotalWithdrawing) * 100 / v.TotalRecharge + } a.Data = values.WithdrawListResp{List: WithdrawOrderArr, Count: count, PayList: payList} } diff --git a/modules/backend/handler/guser/getGameUserInfo.go b/modules/backend/handler/guser/getGameUserInfo.go index f6bdf97..53857f3 100644 --- a/modules/backend/handler/guser/getGameUserInfo.go +++ b/modules/backend/handler/guser/getGameUserInfo.go @@ -95,7 +95,7 @@ func GetGameUserInfo(c *gin.Context) { // usdtInfo := call.GetPlayerRechargeInfoByCurrency(uid, common.CurrencyUSDT) resp.RechargeBrl = brlInfo.TotalRecharge resp.WithdrawBrl = brlInfo.TotalWithdraw - resp.Rtp = call.GetRtpControlV1(uid) + resp.Rtp = call.GetRtpControlV1(uid, &resp.WithdrawPer) // resp.RechargeUsdt = usdtInfo.TotalRecharge // resp.WithdrawUsdt = usdtInfo.TotoalWithdraw diff --git a/modules/backend/values/examine.go b/modules/backend/values/examine.go index 37a1752..c47828d 100644 --- a/modules/backend/values/examine.go +++ b/modules/backend/values/examine.go @@ -66,11 +66,13 @@ type WithdrawInfo struct { Platform int Mobile string Tag string - Brl int64 - TotalRecharge int64 + Inr int64 + TotalRecharge int64 `json:"RechargeTotal"` TotalRechargeCount int64 - TotalWithdraw int64 - TotalWithdrawCount int64 + TotalWithdrawing int64 + TotalWithdraw int64 `json:"Totalwithdraw"` + TotalWithdrawCount int64 `json:"WithDrawCount"` + WithDrawPer int64 `json:"WithDrawPer"` } // WithdrawOrder 退出订单 diff --git a/modules/backend/values/gameuser.go b/modules/backend/values/gameuser.go index b03c285..f6613f7 100644 --- a/modules/backend/values/gameuser.go +++ b/modules/backend/values/gameuser.go @@ -138,6 +138,7 @@ type GetGameUserInfoResp struct { Gpsadid string SubAccount []int Rtp int + WithdrawPer int } type GetGameUserInfoV1Resp struct {