Compare commits

...

2 Commits

  1. 14
      call/activity.go
  2. 13
      call/config.go
  3. 4
      call/user.go
  4. 15
      modules/backend/handler/statistics/rechargeOrderList.go
  5. 10
      modules/backend/models/db.go
  6. 1
      modules/backend/values/statistics.go
  7. 2
      modules/web/handler/pdd.go
  8. 2
      modules/web/providers/sn/handler.go

@ -247,14 +247,16 @@ func UpdateUserActivitySlotsData(uid int, count int) {
db.Mysql().Update(&common.ActivitySlotsData{UID: uid}, update) db.Mysql().Update(&common.ActivitySlotsData{UID: uid}, update)
} }
func ShouldShowActivityLuckShop(uid int) bool { func ShouldShowActivityLuckShop(uid int) (result bool) {
if !IsActivityValid(common.ActivityIDLuckyShop) { luckyWheel := GetConfigLuckyWheel()
return false if luckyWheel == nil {
return
} }
if uid == 0 { rechargeInfo := GetRechargeInfo(uid)
return true if rechargeInfo.TotalRechargeCount <= int64(luckyWheel.RechargeCount) {
return
} }
return GetShowActivityLuckShopData(uid) != nil return true
} }
func GetShowActivityLuckShopData(uid int) *common.ActivityLuckyShopData { func GetShowActivityLuckShopData(uid int) *common.ActivityLuckyShopData {

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

@ -888,6 +888,7 @@ func GetRtpControlV1(uid int, withdrawPer ...*int) int {
if v := GetConfigPlatform().Rtp; v > 0 { if v := GetConfigPlatform().Rtp; v > 0 {
rtp = v rtp = v
} }
userInfo, _ := GetUserInfo(uid)
rechargeInfo := GetRechargeInfo(uid) rechargeInfo := GetRechargeInfo(uid)
cash := GetUserCurrency(uid, common.CurrencyINR) // 当前现金 cash := GetUserCurrency(uid, common.CurrencyINR) // 当前现金
var withdrawRechargePer, personalRtp int64 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))) 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() rtpControls := GetConfigRtpControl()
var rtpControl *common.ConfigRtpControl var rtpControl *common.ConfigRtpControl
for _, v := range rtpControls { for _, v := range rtpControls {

@ -35,9 +35,9 @@ func RechargeOrderList(c *gin.Context) {
var str string var str string
if req.Status != nil && *req.Status == 2 { 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 { } 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 { if req.Channel != nil {
str += fmt.Sprintf(" AND channel_id = %d", *req.Channel) 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) 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 " 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 { if req.Birth != nil {

@ -1114,9 +1114,9 @@ func GetNewPayCountBySqls(s, e int64, channel ...*int) int64 {
var temp int64 var temp int64
sql := fmt.Sprintf(`SELECT COUNT(u.id) AS count FROM users AS u sql := fmt.Sprintf(`SELECT COUNT(u.id) AS count FROM users AS u
inner JOIN 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 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 { if len(channel) > 0 {
sql += PackChannels(channel...) 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 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 `, WHERE event in (%v,%v) and status = %v and callback_time >= %d and callback_time < %d `,
common.CurrencyEventReCharge, common.StatusROrderPay, s, e, common.CurrencyEventReCharge, common.CurrencyEventActivityWeekCard, common.StatusROrderPay, s, e,
) )
if len(channel) > 0 { if len(channel) > 0 {
sql += PackChannels(channel...) sql += PackChannels(channel...)
@ -1388,7 +1388,7 @@ func GetOrderCount(su, eu int64, status, opt int, channel ...*int) int64 {
var model interface{} var model interface{}
if opt == 1 { if opt == 1 {
model = &common.RechargeOrder{} model = &common.RechargeOrder{}
condi = fmt.Sprintf("event = %d ", common.CurrencyEventReCharge) condi = fmt.Sprintf("event in (%d,%d) ", common.CurrencyEventReCharge, common.CurrencyEventActivityWeekCard)
} else { } else {
model = &common.WithdrawOrder{} model = &common.WithdrawOrder{}
condi = fmt.Sprintf("event = %d ", common.CurrencyEventWithDraw) condi = fmt.Sprintf("event = %d ", common.CurrencyEventWithDraw)

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

@ -171,7 +171,7 @@ func PddLottery(c *gin.Context) {
var award string var award string
amountFinal := pddData.Amount amountFinal := pddData.Amount
lessAmount := float64(pdd.WithdrawalAmount) - userAmount lessAmount := float64(pdd.WithdrawalAmount) - userAmount
if pddData.InviterAmount >= int64(pdd.WithdrawalAmount)*20 { if pddData.InviterAmount >= int64(pdd.WithdrawalAmount*common.DecimalDigits)*20 {
award = fmt.Sprintf("%v", lessAmount) award = fmt.Sprintf("%v", lessAmount)
amountFinal = fmt.Sprintf("%d", pdd.WithdrawalAmount) amountFinal = fmt.Sprintf("%d", pdd.WithdrawalAmount)
updateValues["amount"] = amountFinal updateValues["amount"] = amountFinal

@ -167,6 +167,7 @@ func GameBet(c *gin.Context) {
} }
betResp := base.SessionBet(betReq) betResp := base.SessionBet(betReq)
if betResp.Code != base.CodeOk { if betResp.Code != base.CodeOk {
log.Error("sn gameBetResp err,%s:%v", account, betResp.Code)
resp.Code = INVALIDREQUESTERR resp.Code = INVALIDREQUESTERR
if betResp.Code == base.CodeAccepted { if betResp.Code == base.CodeAccepted {
resp.Msg = "duplicate order" resp.Msg = "duplicate order"
@ -175,7 +176,6 @@ func GameBet(c *gin.Context) {
} else { } else {
resp.Msg = "operation failed." resp.Msg = "operation failed."
} }
log.Error("sn gameBetResp err,%s:%v", account, resp.Code)
return return
} }
resp.Data.DeductionAmount = betAmount resp.Data.DeductionAmount = betAmount

Loading…
Cancel
Save