s
This commit is contained in:
parent
3427e6cae2
commit
ff4ead0156
@ -2,6 +2,7 @@
|
|||||||
namespace app\api\controller;
|
namespace app\api\controller;
|
||||||
|
|
||||||
use app\api\logic\VehicleLogic;
|
use app\api\logic\VehicleLogic;
|
||||||
|
use app\common\model\vehicle\Vehicle;
|
||||||
use think\response\Json;
|
use think\response\Json;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -11,7 +12,7 @@ use think\response\Json;
|
|||||||
*/
|
*/
|
||||||
class VehicleController extends BaseApiController
|
class VehicleController extends BaseApiController
|
||||||
{
|
{
|
||||||
public array $notNeedLogin = ['checkNum','vehicleRent','companyCarList','addVehicle','getCarLocal','getCarHistory'];
|
public array $notNeedLogin = ['checkNum','vehicleRent','companyCarList','addVehicle','getSelfCar','getCarLocal','getCarHistory'];
|
||||||
|
|
||||||
|
|
||||||
//验证租赁数量
|
//验证租赁数量
|
||||||
@ -81,6 +82,20 @@ class VehicleController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSelfCar():Json {
|
||||||
|
//获取参数
|
||||||
|
$company_id = $this->request->post('company_id');
|
||||||
|
if(empty($company_id)){
|
||||||
|
return $this->fail('缺少必要参数');
|
||||||
|
}
|
||||||
|
$car = Vehicle::field('id')->where('company_id',$company_id)->where('type',1)->find();
|
||||||
|
if($car){
|
||||||
|
return $this->success('请求成功',['has_car'=>true]);
|
||||||
|
}else{
|
||||||
|
return $this->success('请求成功',['has_car'=>false]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//获取车辆当前位置
|
//获取车辆当前位置
|
||||||
public function getCarLocal():Json {
|
public function getCarLocal():Json {
|
||||||
$params = $this->request->get(['car_id']);
|
$params = $this->request->get(['car_id']);
|
||||||
|
@ -31,3 +31,4 @@ Route::rule('getCarLocal','Vehicle/getCarLocal','get');
|
|||||||
Route::rule('getCarHistory','Vehicle/getCarHistory','get');
|
Route::rule('getCarHistory','Vehicle/getCarHistory','get');
|
||||||
Route::rule('companyCarList','Vehicle/companyCarList','post');
|
Route::rule('companyCarList','Vehicle/companyCarList','post');
|
||||||
Route::rule('addVehicle','Vehicle/addVehicle','post');
|
Route::rule('addVehicle','Vehicle/addVehicle','post');
|
||||||
|
Route::rule('getSelfCar','Vehicle/getSelfCar','post');
|
Loading…
x
Reference in New Issue
Block a user