This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user