diff --git a/kernel/RestController.php b/kernel/RestController.php index 0da92ff..2d7596d 100644 --- a/kernel/RestController.php +++ b/kernel/RestController.php @@ -94,7 +94,9 @@ class RestController $model = $this->model->where('id', $id)->first(); foreach ($model->getFillable() as $item){ - $model->{$item} = $data[$item] ?? null; + if (!empty($data[$item])){ + $model->{$item} = $data[$item] ?? null; + } } $model->save();