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