This commit is contained in:
unknown 2023-08-30 16:14:03 +08:00
parent 9a809c7b8e
commit 5694df127f

View File

@ -116,4 +116,36 @@ class ContractController extends BaseAdminController
return false;
}
}
public function lists() {
$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'])){
$where[] = ['status','=', $param['contract_no']];
}
$pageNo = !empty($param['page_no']) ? $param['page_no'] : 1;
$pageSize = !empty($param['page_size']) ? $param['page_size'] : 15;
$data = Contract::where($where)
->page($pageNo, $pageSize)
->order('create_time desc')
->select()
->toArray();
return $this->success('success',$data);
}
public function detail() {
$id = $this->request->get('id');
if(empty($id)){
$this->fail('参数错误');
}
$data = Contract::where('id',$id)->find();
$data['cars_info'] = json_decode($data['cars_info'],true);
return $this->success('success',$data->toArray());
}
}