Skip to content

Commit

Permalink
fix: 修复SysConfig问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wyzheng1997 committed Nov 18, 2024
1 parent 43dec25 commit 8ffc356
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Supports/ConfigFluent.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ public function set(array|string $key, mixed $value = null): static
{
$data = is_array($key) ? $key : [$key => $value];
foreach ($data as $slug => $val) {
if (array_key_exists($slug, $this->attributes)) {
ConfigModel::query()->where('slug', $slug)->update(['value' => $val]);
} else {
ConfigModel::query()->create(['slug' => $slug, 'value' => $val]);
}
ConfigModel::query()->updateOrCreate(['slug' => $slug], ['value' => $val]);
}

// 清除缓存
Expand Down

0 comments on commit 8ffc356

Please sign in to comment.