From da9a007bacec12e13fd5dfa634b04df4a176b8c2 Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Thu, 30 Jun 2022 20:38:41 +0800 Subject: [PATCH] fixed edit --- beike/Repositories/SettingRepo.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/beike/Repositories/SettingRepo.php b/beike/Repositories/SettingRepo.php index 8e2ab515..e83ccab7 100644 --- a/beike/Repositories/SettingRepo.php +++ b/beike/Repositories/SettingRepo.php @@ -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[] = [