['project_id'], '%like%' => ['code', 'drawing_number'], ]; } /** * @notes 获取项目管理--工程变更列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/03/07 15:21 */ public function lists(): array { return ManageEngineeringChanges::where($this->searchWhere) ->field(['id', 'project_id', 'code', 'date', 'position', 'drawing_number', 'overview', 'sign_info']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function($data){ $project = ManageProject::field('project_name')->where('id',$data['project_id'])->findOrEmpty(); $data['project_name'] = $project['project_name']; }) ->toArray(); } /** * @notes 获取项目管理--工程变更数量 * @return int * @author likeadmin * @date 2024/03/07 15:21 */ public function count(): int { return ManageEngineeringChanges::where($this->searchWhere)->count(); } }