['company_type', 'status'], ]; } /** * @notes 获取任务公司排期列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2023/08/08 10:08 */ public function lists(): array { $params = $this->request->param(); $where = []; if (isset($params['company_id']) && $params['company_id'] != '') { $arr = Company::where('company_name', 'like', '%' . $params['company_id'] . '%')->column('id'); if ($arr) { $where[] = ['company_id', 'in', $arr]; } } if ($this->adminInfo['root'] != 1) { $arr = Company::where('area_manager', $this->adminId)->column('id'); if ($arr) { $where[] = ['company_id', 'in', $arr]; } } return TaskScheduling::where($this->searchWhere) ->where($where) ->with(['admin', 'company', 'company_type']) // ->field(['id', 'create_user_id', 'company_id', 'company_type', 'status']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); } /** * @notes 获取任务公司排期数量 * @return int * @author likeadmin * @date 2023/08/08 10:08 */ public function count(): int { return TaskScheduling::where($this->searchWhere)->count(); } }