fix 红包活动

This commit is contained in:
sk 2025-01-03 15:02:33 +08:00
parent 2aff7b19fb
commit 2bcbfaec2f
3 changed files with 30 additions and 2 deletions

View File

@ -65,3 +65,21 @@ func UpdateRedPacketAll(plt string, list []*RedPacket) error {
return nil return nil
} }
// BackRedPacket 红包统计数据
type BackRedPacket struct {
Platform string
Id int32
SnId int32
ItemId int32
ItemNum int64
Ts int64
}
type BackActivityConsume struct {
Platform string
TaskId int32 // 任务id
SnId int32
Num int64 // 消耗钻石数量
}

View File

@ -19,6 +19,8 @@ const (
BackSystemJyb = "back_jyblog" BackSystemJyb = "back_jyblog"
BackActivityLog = "back_activitylog" BackActivityLog = "back_activitylog"
BackOnlineGame = "back_onlinegame" BackOnlineGame = "back_onlinegame"
BackRedPacket = "back_redpacket"
BackConsumeTask = "back_consumetask"
) )
// go后端 // go后端

View File

@ -2425,6 +2425,7 @@ func (this *WelfareMgr) GetRedPacket(p *Player, id int64) *welfare.SCRedPacketDr
RedPacketMgrInst.AddUse(p.Platform, id, reward) RedPacketMgrInst.AddUse(p.Platform, id, reward)
if reward > 0 { if reward > 0 {
data.RN++ data.RN++
pack.Award = []*welfare.PropInfo{{ItemId: cfg.GetItemId(), ItemNum: reward}}
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItems(&model.AddItemParam{
Platform: p.Platform, Platform: p.Platform,
SnId: p.GetSnId(), SnId: p.GetSnId(),
@ -2435,10 +2436,17 @@ func (this *WelfareMgr) GetRedPacket(p *Player, id int64) *welfare.SCRedPacketDr
}) })
} }
//todo 抽奖记录 mq.Write(&model.BackRedPacket{
Platform: p.Platform,
Id: int32(id),
SnId: p.GetSnId(),
ItemId: cfg.GetItemId(),
ItemNum: reward,
Ts: now,
}, mq.BackRedPacket)
_, pack.RemainCount = RedPacketMgrInst.GetRemainTimesByConfig(p, cfg) _, pack.RemainCount = RedPacketMgrInst.GetRemainTimesByConfig(p, cfg)
p.SendToClient(int(welfare.SPacketID_PACKET_SCRedPacketDraw), pack) Send(welfare.OpResultCode_OPRC_Sucess)
return pack return pack
} }