Merge pull request '增加小组公司车辆列表接口' (#48) from zhangwei into master
Reviewed-on: http://git.excellentkk.cn/mkm/TaskSystem/pulls/48
This commit is contained in:
commit
6556acd921
@ -80,6 +80,21 @@ class VehicleController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function villageCompanyCar():Json {
|
||||||
|
//获取公司id
|
||||||
|
$company_id = $this->userInfo['company_id'];
|
||||||
|
if(empty($company_id)){
|
||||||
|
return $this->fail('数据错误');
|
||||||
|
}
|
||||||
|
$result = VehicleLogic::villageCompanyCar($company_id);
|
||||||
|
//返回数据
|
||||||
|
if($result['code'] == 1){
|
||||||
|
return $this->success($result['msg'],$result['data']);
|
||||||
|
}else{
|
||||||
|
return $this->fail($result['msg']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function addCar():Json {
|
public function addCar():Json {
|
||||||
//获取参数
|
//获取参数
|
||||||
$params = $this->request->post(['license']);
|
$params = $this->request->post(['license']);
|
||||||
|
@ -90,6 +90,24 @@ class VehicleLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function villageCompanyCar($company_id):array {
|
||||||
|
$result = curl_post(self::$url.'/api/companyCar',[],['company_id'=>$company_id]);
|
||||||
|
//返回数据
|
||||||
|
if($result && $result['code'] == 1){
|
||||||
|
if($result['data']['type'] == 1 && $result['data']['lessee_two_flag'] == 1){
|
||||||
|
$lessee_two_company = Company::where('id','lessee_two_company_id')->find();
|
||||||
|
$result['data']['lessee_two_company_address'] = $lessee_two_company['address'];
|
||||||
|
}
|
||||||
|
if($result['data']['type'] == 2){
|
||||||
|
$lessee_two_company = Company::where('id',$result['data']['company_id'])->find();
|
||||||
|
$result['data']['lessee_two_company_address'] = $lessee_two_company['address'];
|
||||||
|
}
|
||||||
|
return ['code'=>1,'msg'=>'请求成功','data'=>$result['data']];
|
||||||
|
}else{
|
||||||
|
return ['code'=>0,'msg'=>'请求失败'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static function addCar($params):array {
|
public static function addCar($params):array {
|
||||||
$company = Company::field('company_type')->where('id',$params['company_id'])->find();
|
$company = Company::field('company_type')->where('id',$params['company_id'])->find();
|
||||||
if($company['company_type'] != 18){
|
if($company['company_type'] != 18){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user