上传推送礼包
This commit is contained in:
parent
972b5a4df7
commit
d247d3e723
@ -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 _, target := range targets {
|
||||||
|
ok = false
|
||||||
for _, v := range info.Item {
|
for _, v := range info.Item {
|
||||||
if _, ok = targets[v.Id]; ok {
|
if target.Id == v.Id {
|
||||||
v.Stime = configure.Now().Unix()
|
v.Stime = configure.Now().Unix()
|
||||||
} else {
|
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(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(item) > 0 {
|
||||||
info.Item = append(info.Item, item...)
|
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})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user