From 788cb2e6d42c61ba1417b98886777180b18e4914 Mon Sep 17 00:00:00 2001 From: ayflying Date: Wed, 27 Aug 2025 10:31:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=81=E4=B9=85=E5=8C=96=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E4=BC=9A=E6=8F=90=E5=89=8D=E7=BB=93=E6=9D=9F=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=8A=9B=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/logic/gameAct/gameAct.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/logic/gameAct/gameAct.go b/internal/logic/gameAct/gameAct.go index ac1dc3f..5eec6d5 100644 --- a/internal/logic/gameAct/gameAct.go +++ b/internal/logic/gameAct/gameAct.go @@ -212,7 +212,7 @@ func (s *sGameAct) Save(ctx context.Context, actId int) (err error) { if len(delKey) > 0 { for _, v := range update { v.UpdatedAt = gtime.Now() - _, err2 := g.Model(Name).Where(do.GameAct{ + updateRes, err2 := g.Model(Name).Where(do.GameAct{ Uid: v.Uid, ActId: v.ActId, }).Data(v).Update() @@ -220,6 +220,10 @@ func (s *sGameAct) Save(ctx context.Context, actId int) (err error) { g.Log().Error(ctx, err2) return } + if row, _ := updateRes.RowsAffected(); row == 0 { + g.Log().Error(ctx, "本次更新为0,更新数据失败: %v", v) + return + } } update = make([]*entity.GameAct, 0) var count int64