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()); + } }