Compare commits

..

No commits in common. '68abda7e58345fe53f63671fd5854986f1fa3d07' and 'ff03e9766533a5d5d926248fd7fee8089099b944' have entirely different histories.

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

@ -3,6 +3,7 @@ package call
import (
"encoding/json"
"errors"
"fmt"
jsoniter "github.com/json-iterator/go"
"net"
"server/common"
@ -1472,12 +1473,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,7 +888,6 @@ 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
@ -909,9 +908,6 @@ 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 in (%d,%d) ", su, eu, common.CurrencyEventReCharge, common.CurrencyEventActivityWeekCard)
str = fmt.Sprintf(" callback_time >= %d AND callback_time < %d AND event = %d ", su, eu, common.CurrencyEventReCharge)
} else {
str = fmt.Sprintf(" create_time >= %d AND create_time < %d AND event in (%d,%d) ", su, eu, common.CurrencyEventReCharge, common.CurrencyEventActivityWeekCard)
str = fmt.Sprintf(" create_time >= %d AND create_time < %d AND event = %d ", su, eu, common.CurrencyEventReCharge)
}
if req.Channel != nil {
str += fmt.Sprintf(" AND channel_id = %d", *req.Channel)
@ -46,17 +46,6 @@ 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 in (%v,%v) AND status = %v AND callback_time >= %d AND callback_time < %d )as re
(select distinct(uid) from recharge_order WHERE event = %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.CurrencyEventActivityWeekCard, common.StatusROrderPay, i, i+oneDay, i, i+oneDay)
where u.birth >= %d AND u.birth < %d`, common.CurrencyEventReCharge, 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 in (%v,%v) and status = %v and callback_time >= %d and callback_time < %d `,
common.CurrencyEventReCharge, common.CurrencyEventActivityWeekCard, common.StatusROrderPay, s, e,
WHERE event = %v and status = %v and callback_time >= %d and callback_time < %d `,
common.CurrencyEventReCharge, 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 in (%d,%d) ", common.CurrencyEventReCharge, common.CurrencyEventActivityWeekCard)
condi = fmt.Sprintf("event = %d ", common.CurrencyEventReCharge)
} else {
model = &common.WithdrawOrder{}
condi = fmt.Sprintf("event = %d ", common.CurrencyEventWithDraw)

@ -1152,7 +1152,6 @@ 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"`

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

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

Loading…
Cancel
Save