diff --git a/app/adminapi/lists/cost_project/CostApprovedProjectLists.php b/app/adminapi/lists/cost_project/CostApprovedProjectLists.php index 4389f2667..6f641f29c 100644 --- a/app/adminapi/lists/cost_project/CostApprovedProjectLists.php +++ b/app/adminapi/lists/cost_project/CostApprovedProjectLists.php @@ -63,19 +63,17 @@ use app\common\model\financial\FinancialInvoice; */ public function lists(): array { - $where=[ - ['review_status','=', 1], - ['contract_type','=',0], - ['status','=',0] - ]; + $this->searchWhere[]=['review_status','=', 1]; + $this->searchWhere[]=['contract_type','=', 0]; + $this->searchWhere[]=['status','=', 1]; $types=$this->request->get('type_value'); if($types){ $data=DictData::where('type_value',$types)->column('value'); if($data){ - $where[]=['business_nature','in',$data]; + $this->searchWhere[]=['business_nature','in',$data]; } } - return MarketingContract::where($this->searchWhere)->where($where) + return MarketingContract::where($this->searchWhere) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() @@ -135,11 +133,7 @@ use app\common\model\financial\FinancialInvoice; */ public function count(): int { - return MarketingContract::where($this->searchWhere)->where([ - ['review_status','=', 1], - ['contract_type','=',0], - ['status','=',0] - ])->count(); + return MarketingContract::where($this->searchWhere)->count(); } public function setFileName(): string