['project_filing_id', 'filing_role', 'status'], '%like%' => ['filing_user'], ]; } /** * @notes 获取市场经营--项目备案明细列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/04/05 10:36 */ public function lists(): array { return MarketingProjectFilingDetail::withoutField('create_time,update_time,delete_time')->where($this->searchWhere) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($data) { $project_filing = MarketingProjectFiling::field('contract_id')->where('id', $data['project_filing_id'])->findOrEmpty(); $contract = MarketingContract::field('contract_name,contract_code,const_area,business_nature')->where('id', $project_filing['contract_id'])->findOrEmpty(); $data['contract_name'] = $contract['contract_name']; $data['contract_code'] = $contract['contract_code']; $data['const_area'] = $contract->const_area_text; $data['business_nature'] = $contract->business_nature_text; $data['filing_role'] = (string)$data['filing_role']; $data['filing_role_text'] = $data->filing_role_text; $data['status'] = (string)$data['status']; $data['status_text'] = $data->status_text; $admin = Admin::field('name')->where('id', $data['filing_user'])->findOrEmpty(); $data['filing_user_name'] = $admin?->name; }) ->toArray(); } /** * @notes 获取市场经营--项目备案明细数量 * @return int * @author likeadmin * @date 2024/04/05 10:36 */ public function count(): int { return MarketingProjectFilingDetail::where($this->searchWhere)->count(); } }