diff --git a/app/Services/ParkingSpaceService.php b/app/Services/ParkingSpaceService.php index 497d3d4..98892df 100644 --- a/app/Services/ParkingSpaceService.php +++ b/app/Services/ParkingSpaceService.php @@ -623,9 +623,11 @@ class ParkingSpaceService extends BaseService } // 判断车位状态是否在维修 $item = ParkingSpace::query()->find($space_id); - if ($item['status'] == 2 && $is_now) { - // 删除维修数据这撤销 - $this->updateRepairStatus($space_id, 0); + if ($item) { + if ($item['status'] == 2 && $is_now) { + // 删除维修数据这撤销 + $this->updateRepairStatus($space_id, 0); + } } } }