['labor_type','cid'], '%like%' => ['title'], ]; } /** * @notes 获取工作记录列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/05/23 14:27 */ public function lists(): array { return OaSchedule::where($this->searchWhere)->where('admin_id',$this->adminId) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function($data){ $data['cid_text'] = $data->cid_text; $data['labor_type_text'] = $data->labor_type_text; }) ->toArray(); } /** * @notes 获取工作记录数量 * @return int * @author likeadmin * @date 2024/05/23 14:27 */ public function count(): int { return OaSchedule::where($this->searchWhere)->where('admin_id',$this->adminId)->count(); } }