最大次数统计

dev_aagame_provider
zhora 4 weeks ago
parent 68abda7e58
commit f502e7b4b3
  1. 6
      call/config.go
  2. 6
      modules/web/handler/recharge.go

@ -1469,7 +1469,7 @@ func GetConfigFirstPay() []*common.ConfigFirstPay {
return configFirstPay return configFirstPay
} }
func GetConfigFirstPayByCount(amount int64, buyCountMap map[string]int) (times int, per int64, topThree bool) { func GetConfigFirstPayByCount(uid int, 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 一个额度一个首充计算
@ -1498,6 +1498,10 @@ func GetConfigFirstPayByCount(amount int64, buyCountMap map[string]int) (times i
break break
} }
} }
if buyCount < 20 {
topThree = true
}
//log.Debug("uid:%d rechargeCount:%d per:%d", uid, buyCount, per)
return return
} }

@ -50,7 +50,7 @@ func RechargeInfoFirst(c *gin.Context) {
rechargeInfo := call.GetRechargeInfo(a.UID) rechargeInfo := call.GetRechargeInfo(a.UID)
for _, v := range call.GetConfigFirstPay() { for _, v := range call.GetConfigFirstPay() {
var bonus int64 var bonus int64
_, per, _ := call.GetConfigFirstPayByCount(v.Amount, rechargeInfo.BuyAmountDataMap) _, per, _ := call.GetConfigFirstPayByCount(a.UID, v.Amount, rechargeInfo.BuyAmountDataMap)
if per > 0 { if per > 0 {
bonus = v.Amount * per / 100 bonus = v.Amount * per / 100
} }
@ -122,7 +122,7 @@ func RechargeInfo(c *gin.Context) {
} }
} }
} }
if _, bonus, _ := call.GetConfigFirstPayByCount(one.Amount, rechargeInfo.BuyAmountDataMap); bonus > 0 { if _, bonus, _ := call.GetConfigFirstPayByCount(a.UID, one.Amount, rechargeInfo.BuyAmountDataMap); bonus > 0 {
one.Bonus = bonus * one.Amount / 100 one.Bonus = bonus * one.Amount / 100
} }
resp.List = append(resp.List, one) resp.List = append(resp.List, one)
@ -338,7 +338,7 @@ func NewRechargeImp(req *values.RechargeReq, uid, cid int, ip string) *RechargeI
//per := call.GetConfigFirstPayPerByAmount(notCharge, order.Amount) //per := call.GetConfigFirstPayPerByAmount(notCharge, order.Amount)
var times int var times int
if req.Bonus && req.ActivityID == 0 { if req.Bonus && req.ActivityID == 0 {
buyCount, per, topThree := call.GetConfigFirstPayByCount(order.Amount, re.BuyAmountDataMap) buyCount, per, topThree := call.GetConfigFirstPayByCount(order.UID, order.Amount, re.BuyAmountDataMap)
if per > 0 { if per > 0 {
order.Bonus = order.Amount * per / 100 order.Bonus = order.Amount * per / 100
} }

Loading…
Cancel
Save