更新细节
This commit is contained in:
parent
7f3fc99309
commit
8cb469f899
@ -81,7 +81,11 @@ class ContractLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return Contract::where($this->searchWhere)->count();
|
||||
return Db::name('Contract')->alias('c')
|
||||
->where($this->searchWhere)
|
||||
->leftJoin('bid_buy_bidding_document bbbd','c.id = c.buy_bidding_document_id')
|
||||
->leftJoin('project p','p.id = bbbd.project_id')
|
||||
->leftJoin('custom ct','ct.id = c.customer_id')->count();
|
||||
}
|
||||
|
||||
}
|
@ -95,7 +95,9 @@ class ProcurementContractLists extends BaseAdminDataLists implements ListsSearch
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return ProcurementContract::where($this->searchWhere)->where($this->querySearch())->count();
|
||||
return Db::name('ProcurementContract')->alias('pc')
|
||||
->where($this->searchWhere)->where($this->querySearch())
|
||||
->leftJoin('project p','p.id = pc.project_id')->count();
|
||||
}
|
||||
|
||||
}
|
@ -97,7 +97,9 @@ class SubcontractingContractLists extends BaseAdminDataLists implements ListsSea
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return ProcurementContract::where($this->searchWhere)->where($this->querySearch())->count();
|
||||
return Db::name('ProcurementContract')->alias('pc')
|
||||
->where($this->searchWhere)->where($this->querySearch())
|
||||
->leftJoin('project p','p.id = pc.project_id')->count();
|
||||
}
|
||||
|
||||
}
|
@ -18,7 +18,7 @@ namespace app\adminapi\lists\finance;
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\finance\FinanceInvoiceApply;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* FinanceInvoiceApply列表
|
||||
@ -38,7 +38,7 @@ class FinanceInvoiceApplyLists extends BaseAdminDataLists implements ListsSearch
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['customer_id', 'contract_id', 'invoicing_company_name'],
|
||||
'=' => ['fia.customer_id', 'fia.contract_id', 'fia.invoicing_company_name'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -54,11 +54,22 @@ class FinanceInvoiceApplyLists extends BaseAdminDataLists implements ListsSearch
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return FinanceInvoiceApply::where($this->searchWhere)
|
||||
->field(['*'])
|
||||
return Db::name('FinanceInvoiceApply')->alias('fia')
|
||||
->where($this->searchWhere)
|
||||
->leftJoin('contract c','c.id = fia.contract_id')
|
||||
->leftJoin('bid_buy_bidding_document bbbd','bbbd.id = c.buy_bidding_document_id')
|
||||
->leftJoin('project p','p.id = bbbd.project_id')
|
||||
->leftJoin('custom ct','ct.id = fia.customer_id')
|
||||
->field('c.*, bbbd.project_id, p.name as project_name, ct.name as customer_name')
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->order(['c.id' => 'desc'])
|
||||
->select()->each(function($item, $key){
|
||||
//关联数据 供应商后续添加
|
||||
$item['approve_no'] = '付款单号';
|
||||
$item['approve_step'] = '流程步骤';
|
||||
$item['approve_settle_status'] = 1;
|
||||
return $item;
|
||||
})
|
||||
->toArray();
|
||||
}
|
||||
|
||||
@ -71,7 +82,12 @@ class FinanceInvoiceApplyLists extends BaseAdminDataLists implements ListsSearch
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return FinanceInvoiceApply::where($this->searchWhere)->count();
|
||||
return Db::name('FinanceInvoiceApply')->alias('fia')
|
||||
->where($this->searchWhere)
|
||||
->leftJoin('contract c','c.id = fia.contract_id')
|
||||
->leftJoin('bid_buy_bidding_document bbbd','bbbd.id = c.buy_bidding_document_id')
|
||||
->leftJoin('project p','p.id = bbbd.project_id')
|
||||
->leftJoin('custom ct','ct.id = fia.customer_id')->count();
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user