diff --git a/app/adminapi/controller/contract/ContractController.php b/app/adminapi/controller/contract/ContractController.php index 71de594e..e3fc4111 100644 --- a/app/adminapi/controller/contract/ContractController.php +++ b/app/adminapi/controller/contract/ContractController.php @@ -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()); + } } \ No newline at end of file