['title', 'template_id', 'company_id', 'start_time', 'end_time', 'director_uid', 'type', 'status', 'content'], ]; } /** * @notes 获取任务列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2023/08/05 13:39 */ public function lists(): array { if($this->adminInfo['root']==1){ $where=[]; }else{ $where['company_id']=$this->adminInfo['company_id']; } return Task::where($this->searchWhere) ->where($where) ->field(['id', 'title', 'template_id', 'company_id', 'admin_id', 'start_time', 'end_time', 'director_uid', 'type', 'status', 'content']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); } /** * @notes 获取任务数量 * @return int * @author likeadmin * @date 2023/08/05 13:39 */ public function count(): int { return Task::where($this->searchWhere)->count(); } }