转盘无充值可见;提存比计算规则;修复bug

dev_aagame
zhora 2 weeks ago
parent 9babf19476
commit b68f9f8ab1
  1. 2
      call/activity.go
  2. 1
      common/task.go
  3. 5
      modules/backend/handler/firstpage.go
  4. 16
      modules/backend/models/db.go
  5. 1
      modules/web/handler/activity.go
  6. 2
      modules/web/handler/luckyWheel.go
  7. 1
      modules/web/values/task.go

@ -253,7 +253,7 @@ func ShouldShowActivityLuckShop(uid int) (result bool) {
return
}
rechargeInfo := GetRechargeInfo(uid)
if rechargeInfo.TotalRechargeCount <= int64(luckyWheel.RechargeCount) {
if rechargeInfo.TotalRechargeCount < int64(luckyWheel.RechargeCount) {
return
}
return true

@ -70,6 +70,7 @@ type ConfigTask struct {
Remark string `gorm:"column:remark;type:varchar(256);default:'';comment:备注" web:"remark"`
PreTaskId int `gorm:"column:pre_task_id;type:int(11);default:0;comment:前置任务id" web:"pre_task_id"`
Url string `gorm:"column:url;type:varchar(256);default:'';comment:跳转链接" web:"url"`
Expand string `gorm:"column:expand;type:varchar(256);default:'';comment:扩展信息" web:"expand"`
}
type ConfigTaskStr struct {

@ -103,6 +103,9 @@ func GetFirstPageData(start, end int64, channels ...*int) *values.FirstPageData
// 赠送总额
ret.WithdrawTotal = models.GetWithdrawAmountTotalBySQLs(start, end, common.CurrencyINR, channels...)
// 提现中的钱
withdrawingTotal := models.GetWithdrawingAmountTotalBySQLs(start, end, common.CurrencyINR, channels...)
// 发起充值订单数
ret.RechargeOrderCreate = models.GetOrderCount(start, end, common.StatusROrderCreate, 1, channels...)
@ -119,7 +122,7 @@ func GetFirstPageData(start, end int64, channels ...*int) *values.FirstPageData
ret.RechargeSuccessPer = utils.GetPer(ret.RechargeOrderFinish, ret.RechargeOrderCreate)
// 充值赠送比
ret.WithdrawPer = utils.GetPer(ret.WithdrawTotal, ret.RechargeTotal)
ret.WithdrawPer = utils.GetPer(ret.WithdrawTotal+withdrawingTotal, ret.RechargeTotal)
// 平台下注
ret.Bet = models.GetGameInOut(start, end, 1, channels...)

@ -1366,6 +1366,22 @@ func GetWithdrawAmountTotalBySQLs(s, e int64, t common.CurrencyType, channel ...
return amount
}
// 通过sql查询代付金额
func GetWithdrawingAmountTotalBySQLs(s, e int64, t common.CurrencyType, channel ...*int) int64 {
var amount int64
if s == e {
e += 24 * 60 * 60
}
sql := fmt.Sprintf(`SELECT IFNULL(SUM(amount),0) as amount FROM withdraw_order WHERE event = %v and status in (%v,%v,%v,%v,%v,%v) and callback_time >= %d and callback_time < %d and currency_type = %d`,
common.CurrencyEventWithDraw, common.StatusROrderWaitting, common.StatusROrderCreate, common.StatusROrderPay, common.StatusROrderFail, common.StatusROrderCancel, common.StatusROrderPending, s, e, t)
sql += PackChannels(channel...)
err := db.Mysql().QueryBySql(sql, &amount)
if err != nil {
log.Error("查询支付总金额失败, error : [%s]", err.Error())
}
return amount
}
// 获取首充人数
func GetFirstPayCount(s, e int64, t common.CurrencyType, channel ...*int) int64 {
q := elastic.NewBoolQuery()

@ -114,6 +114,7 @@ func GetUserTaskStatus(a *app.Gin) (ret []*values.OneTask) {
Title: taskMap[v.TaskID].Title,
Url: taskMap[v.TaskID].Url,
Sort: taskMap[v.TaskID].Sort,
Expand: taskMap[v.TaskID].Expand,
}
if oneTask.Progress >= oneTask.Target && oneTask.Status != 2 {
oneTask.Status = 1

@ -41,7 +41,7 @@ func LuckyWheelCfg(c *gin.Context) {
}
rechargeInfo := call.GetRechargeInfo(uid)
playerData := call.GetPlayerData(uid)
if rechargeInfo.TotalRechargeCount <= int64(luckyWheel.RechargeCount) {
if rechargeInfo.TotalRechargeCount < int64(luckyWheel.RechargeCount) {
return
}
var (

@ -11,4 +11,5 @@ type OneTask struct {
Title string // 标题
Url string // 跳转链接
Sort int // 排序
Expand string // 扩展信息
}

Loading…
Cancel
Save