增加支付渠道查询;rtp计算时间;首充次数共享;充值金额事件

dev_aagame_provider
zhora 4 weeks ago
parent c71e53b982
commit 68abda7e58
  1. 13
      call/config.go
  2. 4
      call/user.go
  3. 15
      modules/backend/handler/statistics/rechargeOrderList.go
  4. 10
      modules/backend/models/db.go
  5. 1
      modules/backend/values/statistics.go

@ -3,7 +3,6 @@ package call
import (
"encoding/json"
"errors"
"fmt"
jsoniter "github.com/json-iterator/go"
"net"
"server/common"
@ -1473,12 +1472,12 @@ func GetConfigFirstPay() []*common.ConfigFirstPay {
func GetConfigFirstPayByCount(amount int64, buyCountMap map[string]int) (times int, per int64, topThree bool) {
var buyCount int
if buyCountMap != nil {
// todo 一个额度一个首充计算
buyCount = buyCountMap[fmt.Sprintf("%d", amount)]
//// todo 全部额度公用一个首充计算
//for _, count := range buyCountMap {
// buyCount += count
//}
//// todo 一个额度一个首充计算
//buyCount = buyCountMap[fmt.Sprintf("%d", amount)]
// todo 全部额度公用一个首充计算
for _, count := range buyCountMap {
buyCount += count
}
times = buyCount
}
for _, v := range configFirstPay {

@ -888,6 +888,7 @@ func GetRtpControlV1(uid int, withdrawPer ...*int) int {
if v := GetConfigPlatform().Rtp; v > 0 {
rtp = v
}
userInfo, _ := GetUserInfo(uid)
rechargeInfo := GetRechargeInfo(uid)
cash := GetUserCurrency(uid, common.CurrencyINR) // 当前现金
var withdrawRechargePer, personalRtp int64
@ -908,6 +909,9 @@ func GetRtpControlV1(uid int, withdrawPer ...*int) int {
}
rechargeDay := int(math.Ceil(float64(time.Now().Unix()-rechargeInfo.FirstRecharge) / float64(24*60*60)))
if userInfo.Birth > 0 { // rtp计算时间改成用户的注册时间
rechargeDay = int(math.Ceil(float64(time.Now().Unix()-userInfo.Birth) / float64(24*60*60)))
}
rtpControls := GetConfigRtpControl()
var rtpControl *common.ConfigRtpControl
for _, v := range rtpControls {

@ -35,9 +35,9 @@ func RechargeOrderList(c *gin.Context) {
var str string
if req.Status != nil && *req.Status == 2 {
str = fmt.Sprintf(" callback_time >= %d AND callback_time < %d AND event = %d ", su, eu, common.CurrencyEventReCharge)
str = fmt.Sprintf(" callback_time >= %d AND callback_time < %d AND event in (%d,%d) ", su, eu, common.CurrencyEventReCharge, common.CurrencyEventActivityWeekCard)
} else {
str = fmt.Sprintf(" create_time >= %d AND create_time < %d AND event = %d ", su, eu, common.CurrencyEventReCharge)
str = fmt.Sprintf(" create_time >= %d AND create_time < %d AND event in (%d,%d) ", su, eu, common.CurrencyEventReCharge, common.CurrencyEventActivityWeekCard)
}
if req.Channel != nil {
str += fmt.Sprintf(" AND channel_id = %d", *req.Channel)
@ -46,6 +46,17 @@ func RechargeOrderList(c *gin.Context) {
str += fmt.Sprintf(" AND status = %d", *req.Status)
}
if len(req.PayChannels) > 0 {
payChannelStr := ""
for _, v := range req.PayChannels {
if payChannelStr != "" {
payChannelStr += ","
}
payChannelStr += fmt.Sprintf("%d", v)
}
str += fmt.Sprintf(" AND pay_channel in (%s) ", payChannelStr)
}
queryOrder += " LEFT JOIN ( SELECT uid, COALESCE(SUM(amount), 0) AS totalAmount FROM recharge_order WHERE " + str + " GROUP BY uid) rm ON rm.uid = re.uid "
if req.Birth != nil {

@ -1114,9 +1114,9 @@ func GetNewPayCountBySqls(s, e int64, channel ...*int) int64 {
var temp int64
sql := fmt.Sprintf(`SELECT COUNT(u.id) AS count FROM users AS u
inner JOIN
(select distinct(uid) from recharge_order WHERE event = %v AND status = %v AND callback_time >= %d AND callback_time < %d )as re
(select distinct(uid) from recharge_order WHERE event in (%v,%v) AND status = %v AND callback_time >= %d AND callback_time < %d )as re
ON re.uid = u.id
where u.birth >= %d AND u.birth < %d`, common.CurrencyEventReCharge, common.StatusROrderPay, i, i+oneDay, i, i+oneDay)
where u.birth >= %d AND u.birth < %d`, common.CurrencyEventReCharge, common.CurrencyEventActivityWeekCard, common.StatusROrderPay, i, i+oneDay, i, i+oneDay)
if len(channel) > 0 {
sql += PackChannels(channel...)
}
@ -1308,8 +1308,8 @@ func GetAmountTotalBySQLs(s, e int64, channel ...*int) int64 {
}
sql := fmt.Sprintf(`SELECT IFNULL(SUM(amount),0) as RechargeAmount FROM recharge_order
WHERE event = %v and status = %v and callback_time >= %d and callback_time < %d `,
common.CurrencyEventReCharge, common.StatusROrderPay, s, e,
WHERE event in (%v,%v) and status = %v and callback_time >= %d and callback_time < %d `,
common.CurrencyEventReCharge, common.CurrencyEventActivityWeekCard, common.StatusROrderPay, s, e,
)
if len(channel) > 0 {
sql += PackChannels(channel...)
@ -1388,7 +1388,7 @@ func GetOrderCount(su, eu int64, status, opt int, channel ...*int) int64 {
var model interface{}
if opt == 1 {
model = &common.RechargeOrder{}
condi = fmt.Sprintf("event = %d ", common.CurrencyEventReCharge)
condi = fmt.Sprintf("event in (%d,%d) ", common.CurrencyEventReCharge, common.CurrencyEventActivityWeekCard)
} else {
model = &common.WithdrawOrder{}
condi = fmt.Sprintf("event = %d ", common.CurrencyEventWithDraw)

@ -1152,6 +1152,7 @@ type OneWithdrawDetail struct {
// Sort 排序 1:按创建时间排序 2:按历史充值排序 3:当前订单金额
type RechargeOrderListReq struct {
Channel *int `json:"Channel"`
PayChannels []int `json:"PayChannels"`
Status *int `json:"Status"`
Start string `json:"Start" binding:"required"`
End string `json:"End" binding:"required"`

Loading…
Cancel
Save