总withdraw查询

dev_aagame_provider
zhora 1 month ago
parent 57eb9ab13c
commit b9d8c2a71c
  1. 26
      call/user.go
  2. 3
      modules/backend/handler/guser/getGameUserInfo.go
  3. 1
      modules/backend/values/gameuser.go

@ -857,6 +857,32 @@ func GetRtpControl(uid int) int {
return rtp return rtp
} }
func GetAllWithdrawPer(uids []int) (withdrawPer int) {
deduplicateUids := make([]int, 0, len(uids))
uidMap := make(map[int]struct{})
for _, v := range uids {
if _, ok := uidMap[v]; !ok {
uidMap[v] = struct{}{}
deduplicateUids = append(deduplicateUids, v)
}
}
if len(deduplicateUids) == 0 {
return
}
var totalWithdraw, totalWithdrawing, totalRecharge, totalCash int64
for _, uid := range deduplicateUids {
totalCash += GetUserCurrency(uid, common.CurrencyINR)
rechargeInfo := GetRechargeInfo(uid)
totalWithdraw += rechargeInfo.TotalWithdraw
totalWithdrawing += rechargeInfo.WithdrawingCash
totalRecharge += rechargeInfo.TotalRecharge
}
if totalRecharge > 0 {
withdrawPer = int((totalWithdraw + totalWithdrawing + totalCash) * 100 / totalRecharge)
}
return
}
func GetRtpControlV1(uid int, withdrawPer ...*int) int { func GetRtpControlV1(uid int, withdrawPer ...*int) int {
rtp := 85 rtp := 85
if v := GetConfigPlatform().Rtp; v > 0 { if v := GetConfigPlatform().Rtp; v > 0 {

@ -81,6 +81,9 @@ func GetGameUserInfo(c *gin.Context) {
SameIPUids: call.GetUserByDeviceIp(user.IP, "", user.Id), SameIPUids: call.GetUserByDeviceIp(user.IP, "", user.Id),
SameDeviceUids: call.GetUserByDeviceIp("", user.DeviceId, user.Id), SameDeviceUids: call.GetUserByDeviceIp("", user.DeviceId, user.Id),
} }
if len(resp.SameIPUids) > 0 || len(resp.SameDeviceUids) > 0 {
resp.AllWithdrawPer = call.GetAllWithdrawPer(append(append(resp.SameIPUids, resp.SameDeviceUids...), uid))
}
currency := &common.PlayerCurrency{UID: uid} currency := &common.PlayerCurrency{UID: uid}
db.Mysql().Get(currency) db.Mysql().Get(currency)

@ -141,6 +141,7 @@ type GetGameUserInfoResp struct {
SubAccount []int SubAccount []int
Rtp int Rtp int
WithdrawPer int WithdrawPer int
AllWithdrawPer int
} }
type GetGameUserInfoV1Resp struct { type GetGameUserInfoV1Resp struct {

Loading…
Cancel
Save