['project_name', 'project_code', 'company', 'contract'], ]; } /** * @notes 获取基本信息列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/03/11 09:25 */ public function lists(): array { return ConsultProject::where($this->searchWhere) ->field(['id', 'project_name', 'project_code', 'company', 'total_investment', 'contract', 'engineering_status', 'consult_type', 'supervision_department', 'implementation_department', 'project_manager']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function($data){ $data['engineering_status_text'] = $data->engineering_status_text; $data['consult_type_text'] = $data->consult_type_text; }) ->toArray(); } /** * @notes 获取基本信息数量 * @return int * @author likeadmin * @date 2024/03/11 09:25 */ public function count(): int { return ConsultProject::where($this->searchWhere)->count(); } }