diff --git a/call/activity.go b/call/activity.go index b547c87..2f9b333 100644 --- a/call/activity.go +++ b/call/activity.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 diff --git a/common/task.go b/common/task.go index 63bd5cc..1be0598 100644 --- a/common/task.go +++ b/common/task.go @@ -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 { diff --git a/modules/backend/handler/firstpage.go b/modules/backend/handler/firstpage.go index c4d5687..c010235 100644 --- a/modules/backend/handler/firstpage.go +++ b/modules/backend/handler/firstpage.go @@ -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...) diff --git a/modules/backend/models/db.go b/modules/backend/models/db.go index a946863..1ac845a 100644 --- a/modules/backend/models/db.go +++ b/modules/backend/models/db.go @@ -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() diff --git a/modules/web/handler/activity.go b/modules/web/handler/activity.go index b1a3387..9802fc4 100644 --- a/modules/web/handler/activity.go +++ b/modules/web/handler/activity.go @@ -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 diff --git a/modules/web/handler/luckyWheel.go b/modules/web/handler/luckyWheel.go index fce37f3..849b0b0 100644 --- a/modules/web/handler/luckyWheel.go +++ b/modules/web/handler/luckyWheel.go @@ -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 ( diff --git a/modules/web/values/task.go b/modules/web/values/task.go index 2fb82d5..5016eaa 100644 --- a/modules/web/values/task.go +++ b/modules/web/values/task.go @@ -11,4 +11,5 @@ type OneTask struct { Title string // 标题 Url string // 跳转链接 Sort int // 排序 + Expand string // 扩展信息 }