|
|
@ -62,13 +62,22 @@ class ParkingSpaceRepairService extends BaseService |
|
|
DB::beginTransaction(); |
|
|
DB::beginTransaction(); |
|
|
$spaceNameArr = explode(',', $data['parking_space_name']); |
|
|
$spaceNameArr = explode(',', $data['parking_space_name']); |
|
|
foreach ($spaceNameArr as $parking_space_name) { |
|
|
foreach ($spaceNameArr as $parking_space_name) { |
|
|
$space_id = ParkingSpace::getValueId($parking_space_name); |
|
|
$space = ParkingSpace::query()->where('number', $parking_space_name)->first(); |
|
|
if (!$space_id) { |
|
|
if (!$space) { |
|
|
throw new CustomException( |
|
|
throw new CustomException( |
|
|
__service($this->menuTitle . '.space_not_exists') |
|
|
__service($this->menuTitle . '.space_not_exists') |
|
|
. ':' . $parking_space_name |
|
|
. ':' . $parking_space_name |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
// 维修状态不可添加 |
|
|
|
|
|
$space = $space->toArray(); |
|
|
|
|
|
$space_id = $space['id']; |
|
|
|
|
|
if ($space['status'] == 2) { |
|
|
|
|
|
throw new CustomException( |
|
|
|
|
|
__service($this->menuTitle . '.space_exists') |
|
|
|
|
|
. ':' . $parking_space_name |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
$model = $this->createData( |
|
|
$model = $this->createData( |
|
|
$space_id, |
|
|
$space_id, |
|
|
$data['admin_user_id'], |
|
|
$data['admin_user_id'], |
|
|
|