From 9bedfc1dfe1ef14fa323530e1d719feaaa4283a6 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Mon, 13 Jan 2025 15:57:20 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=8E=A8=E5=B8=81=E6=9C=BA=E6=A1=8C?= =?UTF-8?q?=E9=9D=A2=E6=95=B0=E6=8D=AE=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dao/red_packet.go | 4 ---- worldsrv/action_pushcoin.go | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/dao/red_packet.go b/dao/red_packet.go index 3753428..5a10a32 100644 --- a/dao/red_packet.go +++ b/dao/red_packet.go @@ -71,10 +71,6 @@ func (r *RedPacket) GetAll() (res []*modelpkg.RedPacket, err error) { func (r *RedPacket) UpdateAll(list []*modelpkg.RedPacket) error { var operations []mongo.WriteModel for _, v := range list { - updateDataMap := bson.M{ - "$set": v, - } - delete(updateDataMap["$set"].(bson.M), "_id") // 删除 _id 字段 operations = append(operations, mongo.NewUpdateOneModel().SetFilter(bson.M{"_id": v.ID}).SetUpdate(bson.M{"$set": v}).SetUpsert(true)) } diff --git a/worldsrv/action_pushcoin.go b/worldsrv/action_pushcoin.go index ca80bc0..a4fd358 100644 --- a/worldsrv/action_pushcoin.go +++ b/worldsrv/action_pushcoin.go @@ -393,6 +393,7 @@ func Draw(p *Player) { for k, v := range d.GetGain() { pack.ItemId = int32(k) pack.ItemNum = int32(v) + AddValue(p, map[int32]int64{pack.ItemId: int64(pack.ItemNum)}) } if pack.Coin > 0 || pack.ItemId > 0 { p.SendToClient(int(activity.PushCoinPacketID_PACKET_NotifyDrawInfo), pack)