From 9d39dc141ec5c12af7b7f9b222ab54aaaf2a2ab1 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 21 Jul 2022 14:42:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=AD=A6=E5=99=A8=E8=A3=85?= =?UTF-8?q?=E5=A4=87=E6=95=B0=E6=8D=AE=E6=9B=B4=E6=96=B0=E5=BC=82=E5=B8=B8?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/equipment/modelEquipment.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/equipment/modelEquipment.go b/modules/equipment/modelEquipment.go index 39318e9fd..61ba942e1 100644 --- a/modules/equipment/modelEquipment.go +++ b/modules/equipment/modelEquipment.go @@ -106,10 +106,13 @@ func (this *modelEquipmentComp) AddEquipments(uId string, cIds map[int32]uint32) } } } - if err = this.AddLists(uId, add); err != nil { - log.Errorf("err:%v", err) - return + if len(add) > 0 { + if err = this.AddLists(uId, add); err != nil { + log.Errorf("err:%v", err) + return + } } + for _, v := range update { if err = this.ChangeList(uId, v.Id, map[string]interface{}{"overlayNum": v.OverlayNum}); err != nil { log.Errorf("err:%v", err)