|
@@ -15,7 +15,7 @@ class Invoice extends Base{
|
|
$this->model = new \app\cxinv\model\Invoice();
|
|
$this->model = new \app\cxinv\model\Invoice();
|
|
}
|
|
}
|
|
public function List(){
|
|
public function List(){
|
|
- $param= $this->request->param(["start"=>"","end"=>"","supplierNo"=>"","companyNo"=>"","status"=>"",'relaNo'=>'',
|
|
|
|
|
|
+ $param= $this->request->param(["start"=>"","end"=>"","supplierNo"=>"","companyNo"=>"","status"=>"",'relaComNo'=>'',
|
|
"invoice_number"=>"","invoice_type"=>"","page"=>1,"size"=>15,"apply_id"=>""],"post","trim");
|
|
"invoice_number"=>"","invoice_type"=>"","page"=>1,"size"=>15,"apply_id"=>""],"post","trim");
|
|
$where=[];
|
|
$where=[];
|
|
$whereOr=[];
|
|
$whereOr=[];
|
|
@@ -27,23 +27,24 @@ class Invoice extends Base{
|
|
if($param['invoice_number']!=='') $where[]=['invoice_number','like','%'.$param['invoice_number'].'%'];
|
|
if($param['invoice_number']!=='') $where[]=['invoice_number','like','%'.$param['invoice_number'].'%'];
|
|
if($param['invoice_type']!=='') $where[]=['invoice_type','=',$param['invoice_type']];
|
|
if($param['invoice_type']!=='') $where[]=['invoice_type','=',$param['invoice_type']];
|
|
if($param['apply_id']!=='') $where[]=['apply_id','=',$param['apply_id']];
|
|
if($param['apply_id']!=='') $where[]=['apply_id','=',$param['apply_id']];
|
|
- if($param['relaNo']!=='') $where[]=['companyNo|supplierNo','=',$param['relaNo']];
|
|
|
|
|
|
+ if($param['relaComNo']!=='') $where[]=['companyNo|supplierNo','=',$param['relaComNo']];
|
|
if($this->level!=1) {
|
|
if($this->level!=1) {
|
|
- if($param['supplierNo']!==''||$param['companyNo']!==''){
|
|
|
|
- $whereOr[]=['apply_id','=', $this->uid];
|
|
|
|
- if($param['status']!=='') $whereOr[]=['status','=', $param['status']];
|
|
|
|
- if($param['start']!=='') $whereOr[]=['createTime','>=',startTime($param['start'])];
|
|
|
|
- if($param['end']!=='') $whereOr[]=['createTime','<=',endTime($param['end'])];
|
|
|
|
- if($param['invoice_number']!=='') $whereOr[]=['invoice_number','like','%'.$param['invoice_number'].'%'];
|
|
|
|
- if($param['invoice_type']!=='') $whereOr[]=['invoice_type','=',$param['invoice_type']];
|
|
|
|
- if ($param['supplierNo']!=='') $whereOr[]=['supplierNo','like','%'.$param['supplierNo'].'%'];
|
|
|
|
- if ($param['companyNo']!=='') $whereOr[]=['companyNo','like','%'.$param['companyNo'].'%'];
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- $list=$this->model->where($where)->whereOr(function($query)use($whereOr){
|
|
|
|
|
|
+ $whereOr[]=['apply_id','=', $this->uid];
|
|
|
|
+ if($param['status']!=='') $whereOr[]=['status','=', $param['status']];
|
|
|
|
+ if($param['start']!=='') $whereOr[]=['createTime','>=',startTime($param['start'])];
|
|
|
|
+ if($param['end']!=='') $whereOr[]=['createTime','<=',endTime($param['end'])];
|
|
|
|
+ if($param['invoice_number']!=='') $whereOr[]=['invoice_number','like','%'.$param['invoice_number'].'%'];
|
|
|
|
+ if($param['invoice_type']!=='') $whereOr[]=['invoice_type','=',$param['invoice_type']];
|
|
|
|
+ if ($param['supplierNo']!=='') $whereOr[]=['supplierNo','like','%'.$param['supplierNo'].'%'];
|
|
|
|
+ if ($param['companyNo']!=='') $whereOr[]=['companyNo','like','%'.$param['companyNo'].'%'];
|
|
|
|
+ }
|
|
|
|
+ $list=$this->model
|
|
|
|
+ ->where($where)
|
|
|
|
+ ->whereOr(function($query)use($whereOr){
|
|
$query->where($whereOr);
|
|
$query->where($whereOr);
|
|
- })->order('id desc')->paginate(['page'=>$param['page'],'list_rows'=>$param['size']]);
|
|
|
|
|
|
+ })
|
|
|
|
+ ->order('id desc')
|
|
|
|
+ ->paginate(['page'=>$param['page'],'list_rows'=>$param['size']]);
|
|
return success('获取成功',['list'=>$list->items(),'count'=>$list->total()]);
|
|
return success('获取成功',['list'=>$list->items(),'count'=>$list->total()]);
|
|
}
|
|
}
|
|
|
|
|