上传推送礼包

This commit is contained in:
liwei 2023-08-10 16:02:02 +08:00
parent 972b5a4df7
commit d247d3e723

View File

@ -167,17 +167,25 @@ func (this *PushGiftbag) BuriedsNotify(session comm.IUserSession, condis []*pb.C
if len(targets) > 0 { if len(targets) > 0 {
item = make([]*pb.DBPushGiftbagItem, 0) item = make([]*pb.DBPushGiftbagItem, 0)
for _, v := range info.Item { for _, target := range targets {
if _, ok = targets[v.Id]; ok { ok = false
v.Stime = configure.Now().Unix() for _, v := range info.Item {
} else { if target.Id == v.Id {
v.Stime = configure.Now().Unix()
ok = true
break
}
}
if !ok {
item = append(item, &pb.DBPushGiftbagItem{ item = append(item, &pb.DBPushGiftbagItem{
Id: v.Id, Id: target.Id,
Stime: configure.Now().Unix(), Stime: configure.Now().Unix(),
}) })
} }
} }
info.Item = append(info.Item, item...) if len(item) > 0 {
info.Item = append(info.Item, item...)
}
session.SendMsg(string(this.GetType()), "chanage", &pb.PushGiftbagChanagePush{Item: info.Item}) session.SendMsg(string(this.GetType()), "chanage", &pb.PushGiftbagChanagePush{Item: info.Item})
} }
} }