['examine_type'], '%like%' => ['temp_name'], ]; } /** * @notes 获取考核模板列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/06/03 13:35 */ public function lists(): array { return OaExamineTemp::withoutField('update_time,delete_time')->where($this->searchWhere) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function($data){ $data['examine_type_text'] = $data->examine_type_text; $data['total_score'] = OaExamineTempItem::where('examine_temp_id',$data['id'])->sum('score'); }) ->toArray(); } /** * @notes 获取考核模板数量 * @return int * @author likeadmin * @date 2024/06/03 13:35 */ public function count(): int { return OaExamineTemp::where($this->searchWhere)->count(); } }