From b5a1930e48733aed94a3e4acf10f983a9938bb61 Mon Sep 17 00:00:00 2001 From: unknown <736250432@qq.com> Date: Tue, 10 Oct 2023 10:02:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96=E7=A9=BA?= =?UTF-8?q?=E9=97=B2=E8=BD=A6=E8=BE=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/VehicleController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/api/controller/VehicleController.php b/app/api/controller/VehicleController.php index f6897362..661e8c61 100644 --- a/app/api/controller/VehicleController.php +++ b/app/api/controller/VehicleController.php @@ -14,7 +14,7 @@ use think\response\Json; */ class VehicleController extends BaseApiController { - public array $notNeedLogin = ['getCarLocal','getCarHistory','addSelfCar','updateVehicleRent','cancelRent']; + public array $notNeedLogin = ['getCarLocal','getCarHistory','addSelfCar','updateVehicleRent','cancelRent','getFreeCars']; //获取车辆当前位置 public function getCarLocal():Json { @@ -149,4 +149,10 @@ class VehicleController extends BaseApiController return $this->fail('失败'); } } + + //获取空闲车辆 + public function getFreeCars() { + $data = Vehicle::field('id,pic,license')->where('status',0)->where('type',0)->select(); + return $this->success('请求成功',$data->toArray()); + } }