|
|
|
@ -1306,7 +1306,6 @@ func ActivityWeekCardInfo(c *gin.Context) { |
|
|
|
} |
|
|
|
} |
|
|
|
rewardList = append([]int64{cons.DayOneReward}, rewardList...) |
|
|
|
rewardList = append([]int64{cons.DayOneReward}, rewardList...) |
|
|
|
rewardList = append(rewardList, 0) |
|
|
|
rewardList = append(rewardList, 0) |
|
|
|
|
|
|
|
|
|
|
|
if cardInfo.ID <= 0 || len(cardInfo.Rewards) == 0 { |
|
|
|
if cardInfo.ID <= 0 || len(cardInfo.Rewards) == 0 { |
|
|
|
cardInfo.Day = 0 |
|
|
|
cardInfo.Day = 0 |
|
|
|
rewardList, err = util.GenerateRandomSequence(cons.RewardAmount, cons.MiniLimit, 5) |
|
|
|
rewardList, err = util.GenerateRandomSequence(cons.RewardAmount, cons.MiniLimit, 5) |
|
|
|
@ -1373,7 +1372,7 @@ func ActivityWeekCardDraw(c *gin.Context) { |
|
|
|
} |
|
|
|
} |
|
|
|
resp := &values.ActivityWeekCardDrawResp{} |
|
|
|
resp := &values.ActivityWeekCardDrawResp{} |
|
|
|
a.Data = resp |
|
|
|
a.Data = resp |
|
|
|
conf := call.GetConfigActivityWeekCard() |
|
|
|
// conf := call.GetConfigActivityWeekCard()
|
|
|
|
card := call.GetUserWeekCard(a.UID) |
|
|
|
card := call.GetUserWeekCard(a.UID) |
|
|
|
if card.ID == 0 { |
|
|
|
if card.ID == 0 { |
|
|
|
a.Code = values.CodeRetry |
|
|
|
a.Code = values.CodeRetry |
|
|
|
@ -1419,19 +1418,34 @@ func ActivityWeekCardDraw(c *gin.Context) { |
|
|
|
if count >= 3 { |
|
|
|
if count >= 3 { |
|
|
|
up = true |
|
|
|
up = true |
|
|
|
} |
|
|
|
} |
|
|
|
exi2 := int64(300) * common.DecimalDigits |
|
|
|
ticket := call.GetConfigDiscountTicketByAmount(int64(300) * common.DecimalDigits) |
|
|
|
// 判断充值的金额
|
|
|
|
log.Info("ticket:%v", ticket) |
|
|
|
productList := call.GetConfigPayProduct() |
|
|
|
if ticket.Id > 0 { |
|
|
|
for _, product := range productList { |
|
|
|
// 赠送优惠券
|
|
|
|
if product.Amount > card.RechargeAmount && up && exi2 < product.Amount { |
|
|
|
products := call.GetConfigPayProductByActivityID(0) |
|
|
|
exi2 = product.Amount |
|
|
|
nextProduct := &common.ConfigPayProduct{} |
|
|
|
} else if product.Amount < card.RechargeAmount && up && exi2 > product.Amount { |
|
|
|
for _, product := range products { |
|
|
|
exi2 = product.Amount |
|
|
|
if product.Amount > card.RechargeAmount && nextProduct.Amount < product.Amount { |
|
|
|
|
|
|
|
nextProduct = product |
|
|
|
|
|
|
|
} else if product.Amount < card.RechargeAmount && nextProduct.Amount > product.Amount { |
|
|
|
|
|
|
|
nextProduct = product |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var nextTicket common.ConfigDiscountTicket |
|
|
|
|
|
|
|
if nextProduct != nil { |
|
|
|
|
|
|
|
nextTicket = call.GetConfigDiscountTicketByAmount(nextProduct.Amount) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if up { |
|
|
|
|
|
|
|
call.AddUserDiscountTicket(a.UID, ticket.RechargeAmount, ticket.DiscountAmount, -1) |
|
|
|
|
|
|
|
call.SendMailWithContent(a.UID, call.SystemTitle, fmt.Sprintf(call.EmailDiscount, ticket.RechargeAmount/common.DecimalDigits, ticket.DiscountAmount/common.DecimalDigits)) |
|
|
|
|
|
|
|
} else if nextTicket.Id > 0 { |
|
|
|
|
|
|
|
call.AddUserDiscountTicket(a.UID, nextTicket.RechargeAmount, nextTicket.DiscountAmount, -1) |
|
|
|
|
|
|
|
call.SendMailWithContent(a.UID, call.SystemTitle, fmt.Sprintf(call.EmailDiscount, ticket.RechargeAmount/common.DecimalDigits, ticket.DiscountAmount/common.DecimalDigits)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
resp.DiscountTicket = ticket.DiscountAmount |
|
|
|
|
|
|
|
resp.Amount = ticket.RechargeAmount |
|
|
|
} |
|
|
|
} |
|
|
|
call.AddUserDiscountTicket(a.UID, exi2-exi2*conf.Discount/100, exi2, -1) |
|
|
|
|
|
|
|
resp.DiscountTicket = conf.Discount |
|
|
|
|
|
|
|
resp.Amount = exi2 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
resource := common.CurrencyResourceWeekCard |
|
|
|
resource := common.CurrencyResourceWeekCard |
|
|
|
if card.Day > 0 { |
|
|
|
if card.Day > 0 { |
|
|
|
@ -1935,6 +1949,7 @@ func ActivityBetDrawInfo(c *gin.Context) { |
|
|
|
drawInfo.SpinInfo.SpinNum < drawInfo.SpinInfo.SpinCount && |
|
|
|
drawInfo.SpinInfo.SpinNum < drawInfo.SpinInfo.SpinCount && |
|
|
|
now.Unix() >= drawInfo.SpinInfo.NextSpinTIme { |
|
|
|
now.Unix() >= drawInfo.SpinInfo.NextSpinTIme { |
|
|
|
call.PushRed(a.UID, pb.RedPointModule_RedPointFreeSpin, uint32(1)) |
|
|
|
call.PushRed(a.UID, pb.RedPointModule_RedPointFreeSpin, uint32(1)) |
|
|
|
|
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2119,6 +2134,8 @@ func DiscountTicketInfo(c *gin.Context) { |
|
|
|
resp.Ticket = &values.DiscountTicketInfo{ |
|
|
|
resp.Ticket = &values.DiscountTicketInfo{ |
|
|
|
Amount: list[0].Exi1, |
|
|
|
Amount: list[0].Exi1, |
|
|
|
Discount: list[0].Exi2, |
|
|
|
Discount: list[0].Exi2, |
|
|
|
|
|
|
|
Id: int64(list[0].ID), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
resp.ChannelList = call.GetConfigPayChannelsByID(common.CurrencyINR) |
|
|
|
} |
|
|
|
} |
|
|
|
|