['business_opportunity_id', 'bid_type', 'bid_nature', 'approve_check_status'], '%like%' => ['bid_code'], ]; } /** * @notes 获取市场经营--投标管理--投标评审列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/04/11 15:42 */ public function lists(): array { $params = $this->request->get(); $where = []; if (isset($params['construct_company']) && $params['construct_company'] != '') { $business_opportunity_ids = MarketingBusinessOpportunity::where('construct_company', $params['construct_company'])->column('id'); $where[] = ['business_opportunity_id', 'in', $business_opportunity_ids]; } return MarketingBidEvaluation::withoutField('create_time,update_time,delete_time')->where($this->searchWhere)->where($where) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($data) { $data['bid_type_text'] = $data->bid_type_text; $data['bid_nature_text'] = $data->bid_nature_text; $data['approve_check_status_text'] = $data->approve_check_status_text; //业务机会 $business_opportunity = MarketingBusinessOpportunity::withoutField('create_time,update_time,delete_time')->where('id', $data['business_opportunity_id'])->findOrEmpty(); $data['business_opportunity'] = $business_opportunity; $construct_company = MarketingCustom::field('name')->where('id', $business_opportunity['construct_company'])->findOrEmpty(); $admin = Admin::where('id', 'in', [$business_opportunity['head'], $business_opportunity['leader']])->column('name', 'id'); $dept = Dept::field('name')->where('id', $business_opportunity['dept'])->findOrEmpty(); $data['business_opportunity']['construct_company_name'] = $construct_company?->name; $data['business_opportunity']['business_nature_text'] = $business_opportunity->business_nature_text; $data['business_opportunity']['industry_nature_text'] = $business_opportunity->industry_nature_text; $data['business_opportunity']['info_sources_text'] = $business_opportunity->info_sources_text; $data['business_opportunity']['fund_sources_text'] = $business_opportunity->fund_sources_text; $data['business_opportunity']['const_area_text'] = $business_opportunity->const_area_text; $data['business_opportunity']['status_text'] = $business_opportunity->status_text; $data['business_opportunity']['dept_name'] = $dept?->name; $data['business_opportunity']['head_name'] = $admin[$business_opportunity['head']] ?? ''; $data['business_opportunity']['leader_name'] = $admin[$business_opportunity['leader']] ?? ''; if (empty($data['reg_date'])) { $data['reg_status'] = 0; $data['reg_status_text'] = '未报名'; } else { if ($data['review_status'] == 0 && $data['reg_result'] == 0) { $data['reg_status'] = 1; $data['reg_status_text'] = '报名通过'; } else { $data['reg_status'] = 2; $data['reg_status_text'] = '报名不通过'; } } }) ->toArray(); } /** * @notes 获取市场经营--投标管理--投标评审数量 * @return int * @author likeadmin * @date 2024/04/11 15:42 */ public function count(): int { $params = $this->request->get(); $where = []; if (isset($params['construct_company']) && $params['construct_company'] != '') { $business_opportunity_ids = MarketingBusinessOpportunity::where('construct_company', $params['construct_company'])->column('id'); $where[] = ['business_opportunity_id', 'in', $business_opportunity_ids]; } return MarketingBidEvaluation::where($this->searchWhere)->where($where)->count(); } }