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']); $params = $this->request->get(['project_name','custom_name']);
$where = []; $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'] != ''){ if(isset($params['custom_name']) && $params['custom_name'] != ''){
$custom_ids = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id'); $custom_ids = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$project_ids = Project::where('custom_id','in',$custom_ids)->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']); $params = $this->request->get(['project_name','custom_name']);
$where = []; $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'] != ''){ if(isset($params['custom_name']) && $params['custom_name'] != ''){
$custom_ids = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id'); $custom_ids = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
$project_ids = Project::where('custom_id','in',$custom_ids)->column('id'); $project_ids = Project::where('custom_id','in',$custom_ids)->column('id');

View File

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