更新: 重构代码并优化财务统计逻辑中的筛选功能
This commit is contained in:
parent
b093af676c
commit
d42b8150ca
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user