From d59c363f6c9ec210d87994799d3208e8cd9347c7 Mon Sep 17 00:00:00 2001 From: yiqiu Date: Sun, 28 Dec 2025 16:34:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../addon/theme_configurator/model/ThemeConfigModel.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/addon/theme_configurator/model/ThemeConfigModel.php b/plugins/addon/theme_configurator/model/ThemeConfigModel.php index 883aeb2..6303e4a 100644 --- a/plugins/addon/theme_configurator/model/ThemeConfigModel.php +++ b/plugins/addon/theme_configurator/model/ThemeConfigModel.php @@ -87,8 +87,13 @@ class ThemeConfigModel 'update_time' => time(), ]; - // 删除所有旧记录,确保只有一条最新记录 - $this->query()->delete(); + // 查询是否有旧记录 + $exists = $this->query()->find(); + + if ($exists) { + // 有旧记录:删除所有旧记录,确保只有一条最新记录 + $this->query()->delete(); + } // 插入新记录 $this->query()->insert($payload);