|
|
|
|
@ -151,10 +151,14 @@ func RechargeInfo(c *gin.Context) { |
|
|
|
|
}) |
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
if v.Time == -1 { |
|
|
|
|
diff = 0 |
|
|
|
|
} |
|
|
|
|
resp.DiscountTicket = append(resp.DiscountTicket, &values.DiscountTicket{ |
|
|
|
|
Id: v.ID, |
|
|
|
|
Discount: v.Exi1, |
|
|
|
|
TimeLeft: v.Time, |
|
|
|
|
TimeLeftAt: v.Time, |
|
|
|
|
TimeLeft: diff, |
|
|
|
|
Amount: v.Exi2, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
@ -329,11 +333,10 @@ func NewRechargeImp(req *values.RechargeReq, uid, cid int, ip string) *RechargeI |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 只有商城购买才能使用优惠券
|
|
|
|
|
// todo activityId为0才是商城购买
|
|
|
|
|
if req.ProductID == 0 && req.DiscountTicketId > 0 { |
|
|
|
|
// 使用了优惠券
|
|
|
|
|
if req.DiscountTicketId > 0 { |
|
|
|
|
// 判断是否有折扣券
|
|
|
|
|
ticket := call.GetItem(req.DiscountTicketId) |
|
|
|
|
ticket := call.GetItem(req.DiscountTicketId, uid) |
|
|
|
|
if ticket != nil && req.Amount >= ticket.Exi2 { |
|
|
|
|
ticketData := common.ActivityRechargeData{ID: common.ItemDiscountTicket, I1: int(ticket.Exi1), I2: req.Amount} |
|
|
|
|
ticketByte, _ := json.Marshal(ticketData) |
|
|
|
|
@ -346,6 +349,7 @@ func NewRechargeImp(req *values.RechargeReq, uid, cid int, ip string) *RechargeI |
|
|
|
|
//notCharge := re.TotalRecharge == 0
|
|
|
|
|
//per := call.GetConfigFirstPayPerByAmount(notCharge, order.Amount)
|
|
|
|
|
var times int |
|
|
|
|
// todo bonus赠送 且 非活动
|
|
|
|
|
if req.Bonus && req.ActivityID == 0 { |
|
|
|
|
buyCount, per, topThree := call.GetConfigFirstPayByCount(order.UID, order.Amount, re.BuyAmountDataMap) |
|
|
|
|
if per > 0 { |
|
|
|
|
|