|
@@ -28,13 +28,17 @@ class Invoice extends Base{
|
|
|
if($param['invoice_type']!=='') $where[]=['invoice_type','=',$param['invoice_type']];
|
|
|
if($param['apply_id']!=='') $where[]=['apply_id','=',$param['apply_id']];
|
|
|
if($this->level!=1) {
|
|
|
- if($param['supplierNo']!==''||$param['companyNo']!==''){
|
|
|
- $whereOr[]=['apply_id','=', $this->uid];
|
|
|
- if($param['status']!==''){
|
|
|
- $whereOr[]=['status','=', $param['status']];
|
|
|
+ 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']];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
$list=$this->model->where($where)->whereOr(function($query)use($whereOr){
|
|
|
$query->where($whereOr);
|
|
|
})->order('id desc')->paginate(['page'=>$param['page'],'list_rows'=>$param['size']]);
|