Compare commits

..

No commits in common. "1edaac6773f485ce11d8e9f14e4b01c333e12d61" and "09aa018fec93dbe7feff90ae4f16535a2b3cf630" have entirely different histories.

3 changed files with 11 additions and 18 deletions

View File

@ -4377,11 +4377,12 @@ func (this *Player) PhoneLotteryTask(taskId int32, num int64) {
} }
} }
func InviteTask(platform string, psnid, snid, scoreType int32, n int64) { func (this *Player) InviteTask(scoreType int32, gameId int32, n int64) {
if psnid <= 0 || snid <= 0 { if this.PSnId == 0 {
return return
} }
cfg := PlatformMgrSingleton.GetConfig(platform).ActInviteConfig
cfg := PlatformMgrSingleton.GetConfig(this.Platform).ActInviteConfig
switch scoreType { switch scoreType {
case common.InviteScoreTypeBind: case common.InviteScoreTypeBind:
@ -4390,9 +4391,9 @@ func InviteTask(platform string, psnid, snid, scoreType int32, n int64) {
score, ok := cfg.GetPayScore()[n] score, ok := cfg.GetPayScore()[n]
if ok { if ok {
SaveInviteScore(&model.InviteScore{ SaveInviteScore(&model.InviteScore{
Platform: platform, Platform: this.Platform,
SnId: snid, SnId: this.SnId,
InviteSnId: psnid, InviteSnId: this.PSnId,
Tp: scoreType, Tp: scoreType,
Score: score, Score: score,
Ts: time.Now().Unix(), Ts: time.Now().Unix(),
@ -4400,9 +4401,9 @@ func InviteTask(platform string, psnid, snid, scoreType int32, n int64) {
}) })
} else { } else {
SaveInviteScore(&model.InviteScore{ SaveInviteScore(&model.InviteScore{
Platform: platform, Platform: this.Platform,
SnId: snid, SnId: this.SnId,
InviteSnId: psnid, InviteSnId: this.PSnId,
Tp: common.InviteScoreTypeRecharge, Tp: common.InviteScoreTypeRecharge,
Score: cfg.GetRechargeScore(), Score: cfg.GetRechargeScore(),
Ts: time.Now().Unix(), Ts: time.Now().Unix(),

View File

@ -101,6 +101,7 @@ func (t *TaskHandle) TaskUpdate(id int, data any) {
case common.TaskTypePay: // 玩家充值 case common.TaskTypePay: // 玩家充值
p.PhoneLotteryTask(common.TaskTypePay, num) p.PhoneLotteryTask(common.TaskTypePay, num)
p.InviteTask(common.InviteScoreTypePay, int32(info.GameID), num)
case common.TaskTypeWinOrLose: // 游戏输赢金币数量 case common.TaskTypeWinOrLose: // 游戏输赢金币数量
p.PhoneLotteryTask(common.TaskTypeWinOrLose, num) p.PhoneLotteryTask(common.TaskTypeWinOrLose, num)

View File

@ -1708,7 +1708,6 @@ func init() {
SnId: player.SnId, SnId: player.SnId,
Num: money, Num: money,
}) })
InviteTask(msg.Platform, player.PSnId, player.SnId, common.InviteScoreTypePay, money)
} }
player.SendDiffData() player.SendDiffData()
} }
@ -1782,7 +1781,6 @@ func init() {
logger.Logger.Errorf("model.InsertDbShopLog err:%v.", err) logger.Logger.Errorf("model.InsertDbShopLog err:%v.", err)
return nil return nil
} }
InviteTask(msg.Platform, findPlayer.PSnId, findPlayer.SnId, common.InviteScoreTypePay, money)
} }
//账变记录 //账变记录
@ -4162,17 +4160,10 @@ func init() {
SnId: player.SnId, SnId: player.SnId,
Num: int64(info.ConsumeNum), Num: int64(info.ConsumeNum),
}) })
InviteTask(msg.Platform, player.PSnId, player.SnId, common.InviteScoreTypePay, int64(info.ConsumeNum))
} else { } else {
if state == 1 { if state == 1 {
state = 3 state = 3
} }
psnid, err := model.GetPlayerInviteSnid(msg.Platform, info.SnId)
if err != nil {
logger.Logger.Error("UpdateDbShopState.err:", err)
return err
}
InviteTask(msg.Platform, psnid, info.SnId, common.InviteScoreTypePay, int64(info.ConsumeNum))
} }
err := model.UpdateDbShopState(msg.Platform, msg.OrderId, state) err := model.UpdateDbShopState(msg.Platform, msg.OrderId, state)
if err != nil { if err != nil {