Merge pull request 'update' (#123) from zhangwei into dev

Reviewed-on: #123
This commit is contained in:
weiz 2024-01-06 14:06:55 +08:00
commit 0d71230b98

View File

@ -60,7 +60,7 @@ class BidBuyBiddingDocumentLists extends BaseAdminDataLists implements ListsSear
*/
public function lists(): array
{
$params = $this->request->get(['project_name','custom_name']);
$params = $this->request->get(['project_name','custom_name','custom_id']);
$where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$project_ids = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
@ -71,6 +71,10 @@ class BidBuyBiddingDocumentLists extends BaseAdminDataLists implements ListsSear
$project_ids = Project::where('custom_id','in',$custom_ids)->column('id');
$where[] = ['project_id','in',$project_ids];
}
if(isset($params['custom_id']) && $params['custom_id'] != ''){
$project_ids = Project::where('custom_id',$params['custom_id'])->column('id');
$where[] = ['project_id','in',$project_ids];
}
return BidBuyBiddingDocument::field('id,org_id,dept_id,project_id,bid_decision_id,code,bid_document_no,invite_tenders_company_name,bid_company_name,buyer,amount,buy_date,bid_address')
->where($this->searchWhere)->where($where)
->limit($this->limitOffset, $this->limitLength)
@ -104,7 +108,7 @@ class BidBuyBiddingDocumentLists extends BaseAdminDataLists implements ListsSear
*/
public function count(): int
{
$params = $this->request->get(['project_name','custom_name']);
$params = $this->request->get(['project_name','custom_name','custom_id']);
$where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$project_ids = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
@ -115,6 +119,10 @@ class BidBuyBiddingDocumentLists extends BaseAdminDataLists implements ListsSear
$project_ids = Project::where('custom_id','in',$custom_ids)->column('id');
$where[] = ['project_id','in',$project_ids];
}
if(isset($params['custom_id']) && $params['custom_id'] != ''){
$project_ids = Project::where('custom_id',$params['custom_id'])->column('id');
$where[] = ['project_id','in',$project_ids];
}
return BidBuyBiddingDocument::where($this->searchWhere)->where($where)->count();
}