...
|
...
|
@@ -200,6 +200,15 @@ class Car extends Base |
|
|
*/
|
|
|
public function switching_driver(){
|
|
|
$res=Db::name("driver")->where("user_id",$this->auth->id)->find();
|
|
|
$car=Db::name("car")->where("driver_id",$res['id'])->find();
|
|
|
if($car){
|
|
|
$res['license_plate']=$car['license_plate'];
|
|
|
$res['car_model']=$car['car_model'];
|
|
|
$res['car_fleet']=$car['car_fleet'];
|
|
|
}else{
|
|
|
return $this->error("请求失败");
|
|
|
}
|
|
|
|
|
|
if($res){
|
|
|
return $this->success("请求成功",$res);
|
|
|
}else{
|
...
|
...
|
@@ -218,6 +227,20 @@ class Car extends Base |
|
|
return $this->error("请求失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 通过位置查询线路
|
|
|
* @return void
|
|
|
* @throws \think\db\exception\DataNotFoundException
|
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
|
* @throws \think\exception\DbException
|
|
|
*/
|
|
|
public function selectroutebyname(){
|
|
|
$start_address=$this->request->param("start_address");
|
|
|
$end_address=$this->request->param("end_address");
|
|
|
$route=Db::name("route")->where("end_address",$end_address)->where("start_address",$start_address)->find();
|
|
|
return $this->success("请求成功",$route);
|
|
|
}
|
|
|
/**
|
|
|
*
|
|
|
* @return void
|
...
|
...
|
@@ -238,5 +261,4 @@ class Car extends Base |
|
|
return $this->success($content);
|
|
|
}
|
|
|
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|