|
|
|
|
@ -2,7 +2,6 @@ package handler |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"encoding/json" |
|
|
|
|
"fmt" |
|
|
|
|
"server/call" |
|
|
|
|
"server/config" |
|
|
|
|
"server/db" |
|
|
|
|
@ -49,7 +48,7 @@ func RechargeInfoFirst(c *gin.Context) { |
|
|
|
|
rechargeInfo := call.GetRechargeInfo(a.UID) |
|
|
|
|
for _, v := range call.GetConfigFirstPay() { |
|
|
|
|
var bonus int64 |
|
|
|
|
per, _ := call.GetConfigFirstPayByCount(v.Amount, rechargeInfo.BuyAmountDataMap[fmt.Sprintf("%d", v.Amount)]) |
|
|
|
|
_, per, _ := call.GetConfigFirstPayByCount(v.Amount, rechargeInfo.BuyAmountDataMap) |
|
|
|
|
if per > 0 { |
|
|
|
|
bonus = v.Amount * per / 100 |
|
|
|
|
} |
|
|
|
|
@ -121,8 +120,7 @@ func RechargeInfo(c *gin.Context) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
count := rechargeInfo.BuyAmountDataMap[fmt.Sprintf("%d", one.Amount)] |
|
|
|
|
if bonus, _ := call.GetConfigFirstPayByCount(one.Amount, count); bonus > 0 { |
|
|
|
|
if _, bonus, _ := call.GetConfigFirstPayByCount(one.Amount, rechargeInfo.BuyAmountDataMap); bonus > 0 { |
|
|
|
|
one.Bonus = bonus * one.Amount / 100 |
|
|
|
|
} |
|
|
|
|
resp.List = append(resp.List, one) |
|
|
|
|
@ -338,11 +336,11 @@ func NewRechargeImp(req *values.RechargeReq, uid, cid int, ip string) *RechargeI |
|
|
|
|
//per := call.GetConfigFirstPayPerByAmount(notCharge, order.Amount)
|
|
|
|
|
var times int |
|
|
|
|
if req.Bonus && req.ActivityID == 0 { |
|
|
|
|
times = re.BuyAmountDataMap[fmt.Sprintf("%d", order.Amount)] |
|
|
|
|
per, topThree := call.GetConfigFirstPayByCount(order.Amount, times) |
|
|
|
|
buyCount, per, topThree := call.GetConfigFirstPayByCount(order.Amount, re.BuyAmountDataMap) |
|
|
|
|
if per > 0 { |
|
|
|
|
order.Bonus = order.Amount * per / 100 |
|
|
|
|
} |
|
|
|
|
times = buyCount |
|
|
|
|
if topThree { |
|
|
|
|
times++ |
|
|
|
|
} else { |
|
|
|
|
|