diff --git a/call/activity.go b/call/activity.go index b829377..927bcf6 100644 --- a/call/activity.go +++ b/call/activity.go @@ -113,14 +113,35 @@ func ShouldShowActivityFirstRechargeBack(uid int) bool { if uid == 0 { return true } - now := time.Now().Unix() + + now := time.Now() conf := GetConfigActivityFirstRechargeBack() p, _ := GetUserXInfo(uid, "birth") data := GetUserFirstRechargeBackData(uid) - if now > p.Birth+conf.CD { // 超时 + if now.Unix() > p.Birth+conf.CD { // 超时 if data.RewardTime == 0 && data.Reward > 0 { // 有奖励 未领取 return true } + if data.Reward == 0 { // 判断是不是有奖励未计算 + rechargeInfo := GetRechargeInfo(uid) + val := data.Amount - GetUserCurrencyTotal(uid, common.CurrencyINR) - rechargeInfo.WithdrawingCash + if val < 0 { + val = 0 + } + val = val * conf.MaxBack / 100 + update := map[string]interface{}{ + "reward": val, + } + if val == 0 { + update["reward_time"] = now.Unix() + } + db.Mysql().Update(&common.ActivityFirstRechargeBackData{UID: uid}, update) + if val > 0 { + return true + } else { + return false + } + } return false } if data.RewardTime > 0 { // 已经领奖 diff --git a/call/pay.go b/call/pay.go index 214958e..810a73d 100644 --- a/call/pay.go +++ b/call/pay.go @@ -896,5 +896,6 @@ func ActivityWeekCard(r *common.RechargeOrder, product *common.ConfigPayProduct) log.Error("update week card err:%v", err.Error()) return } + UploadActivityData(r.UID, common.ActivityIDWeekCard, common.ActivityDataJoin, r.Amount+r.Bonus) PushRed(r.UID, pb.RedPointModule_RedPointWeekCard, 1) } diff --git a/call/user.go b/call/user.go index c1d1bf9..ce09c51 100644 --- a/call/user.go +++ b/call/user.go @@ -863,8 +863,10 @@ func GetRtpControlV1(uid int, withdrawPer ...*int) int { if int(withdrawRechargePer) > v.WithdrawPer && v.WithdrawPer != -1 { continue } - if int(personalRtp) > v.PersonalRtp && v.PersonalRtp != -1 { - continue + if v.PersonalRtp != 0 { + if int(personalRtp) > v.PersonalRtp && v.PersonalRtp != -1 { + continue + } } rtpControl = v break diff --git a/modules/pay/richpay/values.go b/modules/pay/richpay/values.go index 7d6ab02..5420724 100644 --- a/modules/pay/richpay/values.go +++ b/modules/pay/richpay/values.go @@ -6,7 +6,7 @@ import ( ) const ( - baseURL = "https://uat-pf.dtpaypro.com" + baseURL = "https://uat-pf.dkpaypro.com" tokenURL = "/auth/def/oauth/token" refreshTokenURL = "/auth/def/oauth/refresh_token" payURL = "/open/payin" diff --git a/modules/web/handler/pdd.go b/modules/web/handler/pdd.go index 599d8a8..223b472 100644 --- a/modules/web/handler/pdd.go +++ b/modules/web/handler/pdd.go @@ -308,6 +308,7 @@ func PddDraw(c *gin.Context) { return } resp.Amount = pdd.WithdrawalAmount + call.UploadActivityData(a.UID, common.ActivityIDPDD, common.ActivityDataJoin, int64(pdd.WithdrawalAmount*common.DecimalDigits)) } func PddAwardHistory(c *gin.Context) { diff --git a/modules/web/handler/recharge.go b/modules/web/handler/recharge.go index a377526..28dfca1 100644 --- a/modules/web/handler/recharge.go +++ b/modules/web/handler/recharge.go @@ -30,8 +30,10 @@ func CheckRechargeOrder(c *gin.Context) { // log.Debug("req:%+v", *req) one := &common.RechargeOrder{OrderID: req.OrderID} db.Mysql().Get(one) - resp := values.RechargeOrderResp{} - resp.Status = int(one.Status) + resp := values.RechargeOrderResp{ + Status: int(one.Status), + Amount: one.Amount, + } a.Data = resp // log.Debug("resp:%+v", resp) } diff --git a/modules/web/handler/share.go b/modules/web/handler/share.go index 0c307ab..4d27827 100644 --- a/modules/web/handler/share.go +++ b/modules/web/handler/share.go @@ -917,4 +917,5 @@ func ShareWithdraw(c *gin.Context) { if err != nil { log.Error("update share withdraw info err, %s", err.Error()) } + call.UploadActivityData(a.UID, common.ActivityIDShare, common.ActivityDataJoin, req.Amount) } diff --git a/modules/web/handler/weekCard.go b/modules/web/handler/weekCard.go index 930bc82..99f354b 100644 --- a/modules/web/handler/weekCard.go +++ b/modules/web/handler/weekCard.go @@ -213,5 +213,7 @@ func WeekCardDraw(c *gin.Context) { log.Error("update week card data err, %s", err.Error()) } resp.Reward = awardCount + + call.UploadActivityData(a.UID, common.ActivityIDWeekCard, common.ActivityDataJoin, awardCount) return } diff --git a/modules/web/values/pay.go b/modules/web/values/pay.go index fe4c79b..30d0b58 100644 --- a/modules/web/values/pay.go +++ b/modules/web/values/pay.go @@ -9,6 +9,7 @@ type RechargeOrderReq struct { type RechargeOrderResp struct { Status int + Amount int64 } // Amount 充值金额