修改后台展示,rtp控制

dev_aagame_provider
zhora 2 months ago
parent 86424f0f4c
commit de14cc2db6
  1. 29
      call/user.go
  2. 7
      modules/backend/handler/examine/examine.go
  3. 2
      modules/backend/handler/guser/getGameUserInfo.go
  4. 10
      modules/backend/values/examine.go
  5. 1
      modules/backend/values/gameuser.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
}

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

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

@ -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 退出订单

@ -138,6 +138,7 @@ type GetGameUserInfoResp struct {
Gpsadid string
SubAccount []int
Rtp int
WithdrawPer int
}
type GetGameUserInfoV1Resp struct {

Loading…
Cancel
Save