|
|
|
|
@ -663,6 +663,7 @@ func ActivityFirstRechargeBackInfo(c *gin.Context) { |
|
|
|
|
defer func() { |
|
|
|
|
a.Response() |
|
|
|
|
}() |
|
|
|
|
a.GetUID() |
|
|
|
|
if !a.CheckActivityExpire(common.ActivityIDFirstRechargeBack) { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
@ -671,21 +672,23 @@ func ActivityFirstRechargeBackInfo(c *gin.Context) { |
|
|
|
|
a.Data = resp |
|
|
|
|
data := call.GetUserFirstRechargeBackData(a.UID) |
|
|
|
|
log.Debug("ActivityFirstRechargeBackInfo:%+v", data) |
|
|
|
|
if data.RechargeTime == 0 { |
|
|
|
|
resp.CanRecharge = true |
|
|
|
|
} |
|
|
|
|
resp.ProductList = call.GetConfigPayProductByActivityID(common.ActivityIDFirstRechargeBack) |
|
|
|
|
resp.Recharge = data.Amount |
|
|
|
|
resp.BackPer = conf.MaxBack |
|
|
|
|
if data.Amount < conf.MinRecharge { |
|
|
|
|
if data.RechargeTime == 0 { |
|
|
|
|
resp.CanRecharge = true |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if data.RewardTime > 0 { |
|
|
|
|
resp.Draw = true |
|
|
|
|
} |
|
|
|
|
val := data.Amount - call.GetUserCurrencyTotal(a.UID, common.CurrencyINR) |
|
|
|
|
if val < 0 { |
|
|
|
|
val = 0 |
|
|
|
|
} |
|
|
|
|
val = val * conf.MaxBack / 100 |
|
|
|
|
resp.Back = val |
|
|
|
|
resp.PayAmount = rand.Int63n(1000000) + 10000 |
|
|
|
|
resp.DrawTime = data.RechargeTime + common.ActivityFirstRechargeBackTime |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -708,7 +711,7 @@ func ActivityFirstRechargeBackDraw(c *gin.Context) { |
|
|
|
|
a.Code = values.CodeRetry |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
rows, err := db.Mysql().UpdateRes(&common.ActivityFirstRechargeBackData{UID: a.UID}, map[string]interface{}{"lost": 0}) |
|
|
|
|
rows, err := db.Mysql().UpdateRes(&common.ActivityFirstRechargeBackData{UID: a.UID}, map[string]interface{}{"lost": 0, "reward_time": time.Now().Unix()}) |
|
|
|
|
if err != nil || rows == 0 { |
|
|
|
|
a.Code = values.CodeRetry |
|
|
|
|
return |
|
|
|
|
|