diff --git a/app/Http/Controllers/Admin/ParkingAbnormalController.php b/app/Http/Controllers/Admin/ParkingAbnormalController.php index deb4fc1..32b79bf 100644 --- a/app/Http/Controllers/Admin/ParkingAbnormalController.php +++ b/app/Http/Controllers/Admin/ParkingAbnormalController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers\Admin; use App\Exceptions\CustomException; +use App\Models\Parking; use App\Models\ParkingAbnormal; use App\Services\ApiResponseService; use App\Services\ParkingAbnormalService; @@ -128,6 +129,30 @@ class ParkingAbnormalController extends BaseController } } + public function search(): JsonResponse + { + try { + $data = [ + 'parking_list' => Parking::getData(), + 'date_list' => get_select_data( + $this->service->getDateArr() + ), + 'status_list' => get_select_data( + $this->service->getStatus() + ), + 'operation_list' => get_select_data( + $this->service->getOperationType() + ) + ]; + return $this->responseService->success($data); + } catch (Exception $e) { + $m_prefix = __('exception.exception_handler.resource'); + return $this->responseService->systemError( + $m_prefix . ':' . $e->getMessage() + ); + } + } + public function handle(Request $request): JsonResponse { try { diff --git a/routes/admin/api.php b/routes/admin/api.php index a9c784a..b3738e0 100644 --- a/routes/admin/api.php +++ b/routes/admin/api.php @@ -189,6 +189,7 @@ Route::group(['prefix' => 'admin'], function () { Route::get('/notice/show/{id}', [NoticeController::class, 'show']); // 异常占用 Route::get('/abnormalResourceUsage', [ParkingAbnormalController::class, 'index']); + Route::get('/abnormalResourceUsage/search', [ParkingAbnormalController::class, 'search']); Route::post('/abnormalResourceUsage/handle', [ParkingAbnormalController::class, 'handle']); Route::post('/abnormalResourceUsage/ignore', [ParkingAbnormalController::class, 'ignore']); // 车牌识别率