['bid_document_examination_id', 'project_id'], ]; } /** * @notes 获取投标结果列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2023/12/02 14:54 */ public function lists(): array { $params = $this->request->get(['bid_document_examination_code','project_name']); $where = []; if(isset($params['bid_document_examination_code']) && $params['bid_document_examination_code'] != ''){ $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) ->order(['id' => 'desc']) ->select()->each(function($data){ $project = Project::field('name,project_code,custom_id')->where('id',$data['project_id'])->findOrEmpty(); $custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty(); $bid_document_examination = BidDocumentExamination::field('code,buy_bidding_document_id')->where('id',$data['bid_document_examination_id'])->findOrEmpty(); $buy_bidding_document = BidBuyBiddingDocument::field('bid_decision_id')->where('id',$bid_document_examination['buy_bidding_document_id'])->findOrEmpty(); $bid_decision = BidBiddingDecision::field('bidding_time,bid_opening_date')->where('id',$buy_bidding_document['bid_decision_id'])->findOrEmpty(); $data['project_name'] = $project['name']; $data['project_code'] = $project['project_code']; $data['custom_name'] = $custom['name']; $data['bid_document_examination_code'] = $bid_document_examination['code']; $data['bidding_time'] = $bid_decision['bidding_time']; $data['bid_opening_date'] = $bid_decision['bid_opening_date']; $data['is_successful_text'] = $data->is_successful_text; }) ->toArray(); } /** * @notes 获取投标结果数量 * @return int * @author likeadmin * @date 2023/12/02 14:54 */ public function count(): int { $params = $this->request->get(['bid_document_examination_code','project_name']); $where = []; if(isset($params['bid_document_examination_code']) && $params['bid_document_examination_code'] != ''){ $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(); } }