diff --git a/app/Services/ParkingSpaceRepairService.php b/app/Services/ParkingSpaceRepairService.php index 9bd94ae..fcfd8d2 100644 --- a/app/Services/ParkingSpaceRepairService.php +++ b/app/Services/ParkingSpaceRepairService.php @@ -61,12 +61,14 @@ class ParkingSpaceRepairService extends BaseService try { DB::beginTransaction(); $spaceNameArr = explode(',', $data['parking_space_name']); + $count = count($spaceNameArr); foreach ($spaceNameArr as $parking_space_name) { $space = ParkingSpace::query()->where('number', $parking_space_name)->first(); + $str = $count > 1 ? ':' . $parking_space_name : ''; if (!$space) { throw new CustomException( __service($this->menuTitle . '.space_not_exists') - . ':' . $parking_space_name + . $str ); } // 维修状态不可添加 @@ -75,7 +77,7 @@ class ParkingSpaceRepairService extends BaseService if ($space['status'] == 2) { throw new CustomException( __service($this->menuTitle . '.space_exists') - . ':' . $parking_space_name + . $str ); } $model = $this->createData(