release #12

Merged
mfangming merged 6 commits from release into dev 1 year ago
  1. 6
      call/share.go
  2. 1
      common/share.go
  3. 1
      modules/web/handler/activity.go
  4. 2
      modules/web/handler/withdraw.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}})
}
// 判断分享,发放有效用户奖励

@ -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:来自于哪个分享活动"`
}
// 绑定关系

@ -1082,6 +1082,7 @@ func ActivitySignNewInfo(c *gin.Context) {
a.Msg = "परत न कर"
return
}
call.UploadActivityData(a.UID, common.ActivityIDSign, common.ActivityDataClick, 0)
a.Data = resp
}

@ -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

Loading…
Cancel
Save