Merge pull request '11' (#65) from zhangwei into master
Reviewed-on: http://git.excellentkk.cn/mkm/TaskSystem/pulls/65
This commit is contained in:
commit
096d0cca6c
@ -205,17 +205,6 @@ class VehicleController extends BaseApiController
|
||||
if(empty($company_id)){
|
||||
return $this->fail('公司信息不存在');
|
||||
}
|
||||
//获取当前公司类型
|
||||
$currentCompany = Company::where('id',$company_id)->find();
|
||||
if($currentCompany['company_type'] == 18){
|
||||
$apply = VehicleVillageApply::where('village_company_id',$company_id)->find();
|
||||
$car = VehicleRent::where('rent_company_id',$company_id)->find();
|
||||
$data = [
|
||||
'apply' => $apply->toArray(),
|
||||
'car_list' => $car->toArray()
|
||||
];
|
||||
return $this->success('success',$data);
|
||||
}
|
||||
//获取小组服务公司申请信息
|
||||
$apply = VehicleVillageApply::where('town_company_id',$company_id)->where('status',0)->select();
|
||||
//获取车辆列表
|
||||
@ -247,6 +236,38 @@ class VehicleController extends BaseApiController
|
||||
return $this->success('请求成功',$data);
|
||||
}
|
||||
|
||||
public function villageIndex() {
|
||||
$company_id = $this->userInfo['company_id'];
|
||||
if(empty($company_id)){
|
||||
return $this->fail('公司信息不存在');
|
||||
}
|
||||
$company = Company::where('id',$company_id)->find();
|
||||
if($company['company_type'] != 18){
|
||||
return $this->fail('非小组服务公司');
|
||||
}
|
||||
$apply = VehicleVillageApply::where('village_company_id',$company_id)->find();
|
||||
$data = [
|
||||
'status' => 0,
|
||||
];
|
||||
if($apply){
|
||||
$data['apply'] = $apply->toArray();
|
||||
}else{
|
||||
$data['apply'] = [];
|
||||
}
|
||||
$car = VehicleRent::where('rent_company_id',$company_id)->find();
|
||||
if($car){
|
||||
//当前坐标位置
|
||||
$position = curl_post('http://logistics.lihaink.cn/api/getCarLocal',[],['car_id'=>$car['car_id']]);
|
||||
if($position && $position['code'] == 1){
|
||||
$car['position'] = $position['data'];
|
||||
}
|
||||
$car['company'] = Company::where('id',$car['rent_company_id'])->find()->append(['province_name', 'city_name', 'area_name', 'street_name', 'village_name','brigade_name']);
|
||||
}else{
|
||||
$data['car'] = [];
|
||||
}
|
||||
return $this->success('success',$data);
|
||||
}
|
||||
|
||||
//车辆详情
|
||||
public function vehicleInfo() {
|
||||
//获取参数
|
||||
@ -270,10 +291,11 @@ class VehicleController extends BaseApiController
|
||||
|
||||
public function vehicleTrack() {
|
||||
//获取参数
|
||||
$params = $this->request->get(['car_id','start_time','end_time']);
|
||||
$params = $this->request->post(['car_id','start_time','end_time']);
|
||||
if(empty($params['car_id']) || empty($params['start_time']) || empty($params['end_time'])){
|
||||
return $this->fail('缺少必要参数');
|
||||
}
|
||||
|
||||
//获取轨迹
|
||||
$url = 'http://logistics.lihaink.cn/api/getCarHistory?car_id='.$params['car_id'].'&start_time='.$params['start_time'].'&end_time='.$params['end_time'];
|
||||
$result = curl_get($url);
|
||||
|
Loading…
x
Reference in New Issue
Block a user