diff --git a/call/share.go b/call/share.go index 9a31850..0fb8d1b 100644 --- a/call/share.go +++ b/call/share.go @@ -32,12 +32,14 @@ func ShareBind(share string, isOld bool, uid, cid int) { if share == "" || isOld { return } + activityId := 0 now := time.Now().Unix() codeInfo := &common.ShareActivityCode{ShareCode: share} upInfo := &common.ShareInfo{} db.Mysql().Get(codeInfo) if codeInfo.Id > 0 { upInfo.UID = codeInfo.UID + activityId = codeInfo.ActivityId // 判断是否过期 if now < codeInfo.ExpireAt { util.Go(func() { @@ -52,14 +54,14 @@ func ShareBind(share string, isOld bool, uid, cid int) { if upInfo.ID <= 0 { return } - shareInfo := &common.ShareInfo{UID: uid, UP1: upInfo.UID, UP2: upInfo.UP1, UP3: upInfo.UP2, Time: time.Now().Unix(), ChannelID: cid, Share: util.GetShareCode(uid)} + shareInfo := &common.ShareInfo{UID: uid, UP1: upInfo.UID, UP2: upInfo.UP1, UP3: upInfo.UP2, Time: time.Now().Unix(), ChannelID: cid, Share: util.GetShareCode(uid), ActivityId: activityId} db.Mysql().Create(shareInfo) // 更新上级邀请玩家数 db.Mysql().Update(&common.ShareInfo{UID: upInfo.UID}, map[string]interface{}{"invites": gorm.Expr("invites + 1")}) // 完成邀请任务 - CheckTask(Task{Uid: uid, Value: 1, Types: []common.TaskType{common.TaskTypeInvite}}) + CheckTask(Task{Uid: upInfo.UID, Value: 1, Types: []common.TaskType{common.TaskTypeInvite}}) } // 判断分享,发放有效用户奖励 diff --git a/common/share.go b/common/share.go index c6f8ba2..bcf06a4 100644 --- a/common/share.go +++ b/common/share.go @@ -42,6 +42,7 @@ type ShareInfo struct { BetReward int64 `gorm:"column:bet_reward;type:bigint(20);default:0;comment:邀请人下注获得的金额"` AvailableReward int64 `gorm:"column:available_reward;type:bigint(20);default:0;comment:可支配佣金"` Time int64 `gorm:"column:time;type:bigint(20);default:0;comment:加入的时间"` + ActivityId int `gorm:"column:activity_id;type:int(11);default:0;comment:来自于哪个分享活动"` } // 绑定关系 diff --git a/modules/web/handler/activity.go b/modules/web/handler/activity.go index 8cd089d..fff16d8 100644 --- a/modules/web/handler/activity.go +++ b/modules/web/handler/activity.go @@ -1082,6 +1082,7 @@ func ActivitySignNewInfo(c *gin.Context) { a.Msg = "पात्रता को पूरा न करें" return } + call.UploadActivityData(a.UID, common.ActivityIDSign, common.ActivityDataClick, 0) a.Data = resp } diff --git a/modules/web/handler/withdraw.go b/modules/web/handler/withdraw.go index c0693b1..a97298f 100644 --- a/modules/web/handler/withdraw.go +++ b/modules/web/handler/withdraw.go @@ -350,7 +350,7 @@ func PlayerWithdraw(c *gin.Context) { con := call.GetVipCon(uid) realAmount := need // 实际打款 if con != nil && con.Fee > 0 { - realAmount = common.RoundCurrency(req.CurrencyType, (1000-int64(con.Fee))*realAmount/1000) - 6 // 固定税费 + realAmount = common.RoundCurrency(req.CurrencyType, (1000-int64(con.Fee))*realAmount/1000) - 600 // 固定税费 } var shouldAuto = false