From 83f112c260b0764907d3044e68a29bf7af2e5597 Mon Sep 17 00:00:00 2001 From: luorijun Date: Mon, 11 Aug 2025 16:14:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=85=8D=E7=BD=AE=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- actions/configs.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/actions/configs.go b/actions/configs.go index 30630de..cd68ca9 100644 --- a/actions/configs.go +++ b/actions/configs.go @@ -29,6 +29,13 @@ func UpdateConfigs(tx *gorm.DB, configs []model.ConfigUpdate) error { return nil } - // 使用事务批量更新配置 - return tx.Updates(&configs).Error + // 批量更新配置 + for _, config := range configs { + err := tx.Updates(&config).Error + if err != nil { + return err + } + } + + return nil }