Merge pull request 'update' (#9) from zhangwei into master
Reviewed-on: #9
This commit is contained in:
commit
5209382fd4
@ -94,6 +94,35 @@ class VehicleContractController extends BaseAdminController
|
|||||||
return $this->success('success',['lists'=>$data->toArray(),'page_no'=>$pageNo,'page_size'=>$pageSize,'count'=>$data->count()]);
|
return $this->success('success',['lists'=>$data->toArray(),'page_no'=>$pageNo,'page_size'=>$pageSize,'count'=>$data->count()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function townRentList() {
|
||||||
|
$param = $this->request->get();
|
||||||
|
$where = [];
|
||||||
|
if(isset($param['company_name'])){
|
||||||
|
$where[] = ['company_b_name','like','%'.$param['company_name'].'%'];
|
||||||
|
}
|
||||||
|
if(isset($param['contract_no'])){
|
||||||
|
$where[] = ['contract_no','like','%'.$param['contract_no'].'%'];
|
||||||
|
}
|
||||||
|
if(isset($param['status']) && in_array($param['status'],[0,1])){
|
||||||
|
if($param['status'] == 1){
|
||||||
|
$where[] = ['status','in', '1,2,3'];
|
||||||
|
}else{
|
||||||
|
$where[] = ['status','=', $param['status']];
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$where[] = ['status','in', '0,1,2,3'];
|
||||||
|
}
|
||||||
|
$pageNo = !empty($param['page_no']) ? $param['page_no'] : 1;
|
||||||
|
$pageSize = !empty($param['page_size']) ? $param['page_size'] : 15;
|
||||||
|
$data = VehicleContract::where($where)->where('contract_logistic_id')
|
||||||
|
->page($pageNo, $pageSize)
|
||||||
|
->order('create_time desc')
|
||||||
|
->select()->each(function($item){
|
||||||
|
$item['cars_info'] = json_decode($item['cars_info'],true);
|
||||||
|
});
|
||||||
|
return $this->success('success',['lists'=>$data->toArray(),'page_no'=>$pageNo,'page_size'=>$pageSize,'count'=>$data->count()]);
|
||||||
|
}
|
||||||
|
|
||||||
public function detail() {
|
public function detail() {
|
||||||
$id = $this->request->get('id');
|
$id = $this->request->get('id');
|
||||||
if(empty($id)){
|
if(empty($id)){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user