This commit is contained in:
weiz 2024-03-19 17:05:45 +08:00
parent a8fe4ddc15
commit 81c0059f63
4 changed files with 10 additions and 42 deletions

View File

@ -60,10 +60,6 @@ class BidBiddingDecisionLists extends BaseAdminDataLists implements ListsSearchI
{
$params = $this->request->get(['project_name','custom_name']);
$where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$project_ids = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$project_ids];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){
$custom_ids = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$project_ids = Project::where('custom_id','in',$custom_ids)->column('id');
@ -100,10 +96,6 @@ class BidBiddingDecisionLists extends BaseAdminDataLists implements ListsSearchI
{
$params = $this->request->get(['project_name','custom_name']);
$where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$project_ids = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$project_ids];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){
$custom_ids = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$project_ids = Project::where('custom_id','in',$custom_ids)->column('id');

View File

@ -60,21 +60,17 @@ class BidBuyBiddingDocumentLists extends BaseAdminDataLists implements ListsSear
*/
public function lists(): array
{
$params = $this->request->get(['project_name','custom_name','custom_id']);
$params = $this->request->get();
$where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$project_ids = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$project_ids];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){
$custom_ids = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$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];
}
if(isset($params['bid_decision_code']) && $params['bid_decision_code'] != ''){
$bid_decision_ids = BidBiddingDecision::where('code','like','%'.$params['bid_decision_code'].'%')->column('id');
$where[] = ['bid_decision_id','in',$bid_decision_ids];
}
return BidBuyBiddingDocument::field('id,project_id,bid_decision_id,bid_document_no,invite_tenders_company_name,bid_company_name,buyer,amount,buy_date')
->where($this->searchWhere)->where($where)
->limit($this->limitOffset, $this->limitLength)
@ -108,20 +104,16 @@ class BidBuyBiddingDocumentLists extends BaseAdminDataLists implements ListsSear
*/
public function count(): int
{
$params = $this->request->get(['project_name','custom_name','custom_id']);
$params = $this->request->get();
$where = [];
if(isset($params['project_name']) && $params['project_name'] != ''){
$project_ids = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$project_ids];
}
if(isset($params['custom_name']) && $params['custom_name'] != ''){
$custom_ids = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$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];
if(isset($params['bid_decision_code']) && $params['bid_decision_code'] != ''){
$bid_decision_ids = BidBiddingDecision::where('code','like','%'.$params['bid_decision_code'].'%')->column('id');
$where[] = ['bid_decision_id','in',$bid_decision_ids];
}
return BidBuyBiddingDocument::where($this->searchWhere)->where($where)->count();
}

View File

@ -68,10 +68,6 @@ class BidDocumentExaminationLists extends BaseAdminDataLists implements ListsSea
$bid_doc_ids = BidBuyBiddingDocument::where('bid_document_no','like','%'.$params['bid_document_no'].'%')->column('id');
$where[] = ['buy_bidding_document_id','in',$bid_doc_ids];
}
if(isset($params['project_name']) && $params['project_name'] != ''){
$project_ids = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$project_ids];
}
$field = 'id,code,project_id,buy_bidding_document_id';
return BidDocumentExamination::where($this->searchWhere)->where($where)
->field($field)->limit($this->limitOffset, $this->limitLength)
@ -116,10 +112,6 @@ class BidDocumentExaminationLists extends BaseAdminDataLists implements ListsSea
$bid_doc_ids = BidBuyBiddingDocument::where('bid_document_no','like','%'.$params['bid_document_no'].'%')->column('id');
$where[] = ['buy_bidding_document_id','in',$bid_doc_ids];
}
if(isset($params['project_name']) && $params['project_name'] != ''){
$project_ids = Project::where('name','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$project_ids];
}
return BidDocumentExamination::field('id')->where($this->searchWhere)->where($where)->count();
}

View File

@ -44,7 +44,7 @@ class BidResultLists extends BaseAdminDataLists implements ListsSearchInterface,
public function setSearch(): array
{
return [
'=' => ['bid_document_examination_id', 'project_id'],
'=' => ['project_id'],
];
}
@ -66,10 +66,6 @@ class BidResultLists extends BaseAdminDataLists implements ListsSearchInterface,
$bid_document_examination_ids = BidDocumentExamination::where('code','like','%'.$params['bid_document_examination_code'].'%')->column('id');
$where[] = ['bid_document_examination_id','in',$bid_document_examination_ids];
}
if(isset($params['project_name']) && $params['project_name'] != ''){
$project_ids = Project::where('code','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$project_ids];
}
return BidResult::where($this->searchWhere)->where($where)
->field('id,bid_document_examination_id,project_id,is_successful,bidder_company,bidder_amount')
->limit($this->limitOffset, $this->limitLength)
@ -106,10 +102,6 @@ class BidResultLists extends BaseAdminDataLists implements ListsSearchInterface,
$bid_document_examination_ids = BidDocumentExamination::where('code','like','%'.$params['bid_document_examination_code'].'%')->column('id');
$where[] = ['bid_document_examination_id','in',$bid_document_examination_ids];
}
if(isset($params['project_name']) && $params['project_name'] != ''){
$project_ids = Project::where('code','like','%'.$params['project_name'].'%')->column('id');
$where[] = ['project_id','in',$project_ids];
}
return BidResult::where($this->searchWhere)->where($where)->count();
}