Merge pull request '修改了合同详情页,增加了车辆租赁信息' (#32) from zhangwei into master
Reviewed-on: http://git.excellentkk.cn/mkm/TaskSystem/pulls/32
This commit is contained in:
commit
760ed90575
@ -476,4 +476,14 @@ function append($data, $append, $key = 'id', $appendKey = 'append')
|
||||
$v[$appendKey] = $tmp[$v[$key]] ?? [];
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
function curl_get($url){
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
$output = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
$result = json_decode($output,true);
|
||||
return $result;
|
||||
}
|
@ -177,6 +177,14 @@ class ContractLogic extends BaseLogic
|
||||
return $data['status'] == 1 ? '已签约' : '未签约';
|
||||
})
|
||||
->find();
|
||||
//如果是租赁合同则获取租赁的车辆信息
|
||||
if($data && $data['contract_type'] == 29){
|
||||
$url = 'http://logistics.lihaink.cn/api/getRentRecord?contract_id='.$params['id'];
|
||||
$result = curl_get($url);
|
||||
if($result['code'] == 1){
|
||||
$data['carsRentInfo'] = $result['data'];
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user