fixed edit

This commit is contained in:
Edward Yang 2022-06-30 20:38:41 +08:00
parent 2556a2227f
commit da9a007bac
1 changed files with 7 additions and 1 deletions

View File

@ -53,7 +53,13 @@ class SettingRepo
public static function update($type, $code, $fields)
{
Setting::query()->where('type', $type)->where('space', $code)->delete();
$columns = array_keys($fields);
Setting::query()
->where('type', $type)
->where('space', $code)
->whereIn('name', $columns)
->delete();
$rows = [];
foreach ($fields as $name => $value) {
$rows[] = [