From 020dbf2ff57f93400f76009653ba38835a41d04c Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq.com> Date: Tue, 28 Apr 2026 17:31:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=98=E5=88=B6=E5=9C=B0=E5=9B=BE=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/ParkingElectronicMapService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/ParkingElectronicMapService.php b/app/Services/ParkingElectronicMapService.php index d44c069..7c840f2 100644 --- a/app/Services/ParkingElectronicMapService.php +++ b/app/Services/ParkingElectronicMapService.php @@ -29,7 +29,7 @@ class ParkingElectronicMapService extends BaseService 'floor_id' => $floor_id, 'space_id' => $space_id ]; - $res = ParkingElectronicMap::query()->where($where)->get()->toArray(); + $res = ParkingElectronicMap::query()->where($where)->first(); $saveData['width'] = $data['width'] ?? '0'; $saveData['height'] = $data['height'] ?? '0'; $saveData['coordinate_x'] = $data['coordinate_x'] ?? ''; @@ -40,7 +40,7 @@ class ParkingElectronicMapService extends BaseService $saveData['aspect_ratio'] = $data['aspect_ratio'] ?? ''; if ($res) { $saveData['update_at'] = get_datetime(); - $model = ParkingElectronicMap::query()->findOrFail($res[0]['id']); + $model = ParkingElectronicMap::query()->findOrFail($res['id']); $oldValues = $model->toArray(); $model->update($saveData); $this->logService->logUpdated($model, $oldValues, 'map.save');