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