|
|
|
|
@ -656,10 +656,15 @@ func ActivityFirstRechargeBackInfo(c *gin.Context) { |
|
|
|
|
} |
|
|
|
|
val = val * conf.MaxBack / 100 |
|
|
|
|
now := time.Now().Unix() |
|
|
|
|
if p.Birth+conf.CD >= now && data.Reward == 0 { |
|
|
|
|
db.Mysql().Update(&common.ActivityFirstRechargeBackData{UID: a.UID}, map[string]interface{}{ |
|
|
|
|
if now >= p.Birth+conf.CD && data.Reward == 0 && data.RechargeTime == 0 { |
|
|
|
|
update := map[string]interface{}{ |
|
|
|
|
"reward": val, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if val == 0 { |
|
|
|
|
data.RechargeTime = now |
|
|
|
|
update["reward_time"] = now |
|
|
|
|
} |
|
|
|
|
db.Mysql().Update(&common.ActivityFirstRechargeBackData{UID: a.UID}, update) |
|
|
|
|
} |
|
|
|
|
data.Reward = val |
|
|
|
|
} |
|
|
|
|
@ -667,6 +672,9 @@ func ActivityFirstRechargeBackInfo(c *gin.Context) { |
|
|
|
|
resp.Draw = true |
|
|
|
|
} |
|
|
|
|
resp.Back = data.Reward |
|
|
|
|
if !resp.Draw { |
|
|
|
|
call.PushRed(a.UID, pb.RedPointModule_RedPointFirstRecharge, 1) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func ActivityFirstRechargeBackDraw(c *gin.Context) { |
|
|
|
|
@ -677,11 +685,15 @@ func ActivityFirstRechargeBackDraw(c *gin.Context) { |
|
|
|
|
if !a.CheckActivityExpire(common.ActivityIDFirstRechargeBack) { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
resp := new(values.ActivityFirstRechargeBackDrawResp) |
|
|
|
|
a.Data = resp |
|
|
|
|
conf := call.GetConfigActivityFirstRechargeBack() |
|
|
|
|
data := call.GetUserFirstRechargeBackData(a.UID) |
|
|
|
|
if time.Now().Unix()-data.RechargeTime < conf.CD { |
|
|
|
|
p, _ := call.GetUserXInfo(a.UID, "birth") |
|
|
|
|
if time.Now().Unix()-p.Birth < conf.CD { |
|
|
|
|
log.Error("not ActivityFirstRechargeBackDraw time:%+v", data) |
|
|
|
|
a.Code = values.CodeRetry |
|
|
|
|
a.Msg = "Unarrived time" |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if data.RewardTime > 0 { |
|
|
|
|
@ -708,7 +720,9 @@ func ActivityFirstRechargeBackDraw(c *gin.Context) { |
|
|
|
|
a.Code = values.CodeRetry |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
resp.Reward = val |
|
|
|
|
call.UploadActivityData(a.UID, common.ActivityIDFirstRechargeBack, common.ActivityDataJoin, val) |
|
|
|
|
call.PushRed(a.UID, pb.RedPointModule_RedPointFirstRecharge, 0) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 幸运码活动
|
|
|
|
|
@ -1327,7 +1341,7 @@ func ActivityWeekCardInfo(c *gin.Context) { |
|
|
|
|
for _, item := range rewardList { |
|
|
|
|
resp.RewardList = append(resp.RewardList, values.WeekCardInfo{ |
|
|
|
|
Min: cons.MiniLimit, |
|
|
|
|
Max: cons.RewardAmount, |
|
|
|
|
Max: cons.RewardAmount - cons.MiniLimit*4, |
|
|
|
|
Val: item, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
@ -1340,6 +1354,9 @@ func ActivityWeekCardInfo(c *gin.Context) { |
|
|
|
|
resp.RewardDay = cardInfo.Day |
|
|
|
|
resp.ChannelList = call.GetConfigPayChannelsByID(common.CurrencyINR) |
|
|
|
|
resp.ProductList = call.GetConfigPayProductByActivityID(common.ActivityIDWeekCard) |
|
|
|
|
if resp.Status { |
|
|
|
|
call.PushRed(a.UID, pb.RedPointModule_RedPointWeekCard, 1) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func ActivityWeekCardDraw(c *gin.Context) { |
|
|
|
|
@ -1415,7 +1432,10 @@ func ActivityWeekCardDraw(c *gin.Context) { |
|
|
|
|
call.AddUserDiscountTicket(a.UID, conf.Discount, exi2) |
|
|
|
|
resp.DiscountTicket = conf.Discount |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
resource := common.CurrencyResourceWeekCard |
|
|
|
|
if card.Day > 0 { |
|
|
|
|
resource = common.CurrencyResourceBonus |
|
|
|
|
} |
|
|
|
|
resp.Reward = reward |
|
|
|
|
if reward > 0 { |
|
|
|
|
call.UpdateCurrencyPro(&common.UpdateCurrency{ |
|
|
|
|
@ -1425,10 +1445,11 @@ func ActivityWeekCardDraw(c *gin.Context) { |
|
|
|
|
Value: reward, |
|
|
|
|
Event: common.CurrencyEventActivityWeekCard, |
|
|
|
|
ChannelID: a.Channel, |
|
|
|
|
NeedBet: call.GetConfigCurrencyResourceNeedBet(common.CurrencyResourceWeekCard, reward), |
|
|
|
|
NeedBet: call.GetConfigCurrencyResourceNeedBet(resource, reward), |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
call.PushRed(a.UID, pb.RedPointModule_RedPointWeekCard, 0) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -1894,11 +1915,6 @@ func ActivityBetDrawInfo(c *gin.Context) { |
|
|
|
|
Lucky: drawInfo.Lucky, |
|
|
|
|
} |
|
|
|
|
a.Data = resp |
|
|
|
|
for _, item := range resp.List { |
|
|
|
|
if resp.Lucky >= item.Cost && vipInfo.Level >= item.VipUnlock { |
|
|
|
|
call.PushRed(a.UID, pb.RedPointModule_RedPointFreeSpin, uint32(1)) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
now := time.Now() |
|
|
|
|
update := false |
|
|
|
|
if !util.IsSameDayTimeStamp(drawInfo.SpinInfo.LastSpinTime, now.Unix()) { |
|
|
|
|
@ -1913,6 +1929,13 @@ func ActivityBetDrawInfo(c *gin.Context) { |
|
|
|
|
drawInfo.SpinInfo.SpinCount = confList[0].LimitNum |
|
|
|
|
resp.SpinInfo = append(resp.SpinInfo, drawInfo.SpinInfo) |
|
|
|
|
call.UploadActivityData(a.UID, common.ActivityIDBetDraw, common.ActivityDataClick, 0) |
|
|
|
|
for _, item := range resp.List { |
|
|
|
|
if resp.Lucky >= item.Cost && vipInfo.Level >= item.VipUnlock && |
|
|
|
|
drawInfo.SpinInfo.SpinNum < drawInfo.SpinInfo.SpinCount && |
|
|
|
|
now.Unix() >= drawInfo.SpinInfo.NextSpinTIme { |
|
|
|
|
call.PushRed(a.UID, pb.RedPointModule_RedPointFreeSpin, uint32(1)) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func ActivityBetDrawDraw(c *gin.Context) { |
|
|
|
|
@ -2000,14 +2023,8 @@ func ActivityBetDrawDraw(c *gin.Context) { |
|
|
|
|
|
|
|
|
|
drawInfo = common.ActivityBetDrawData{UID: a.UID} |
|
|
|
|
db.Mysql().Get(&drawInfo) |
|
|
|
|
list := call.GetConfigBetDraw() |
|
|
|
|
num := 0 |
|
|
|
|
for _, item := range list { |
|
|
|
|
if drawInfo.Lucky >= item.Cost { |
|
|
|
|
num++ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
call.PushRed(a.UID, pb.RedPointModule_RedPointFreeSpin, uint32(num)) |
|
|
|
|
|
|
|
|
|
call.PushRed(a.UID, pb.RedPointModule_RedPointFreeSpin, uint32(0)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func ActivityBetDrawHistory(c *gin.Context) { |
|
|
|
|
|