['type'] ]; } public function queryWhere() { $where = []; $param = $this->request->param(); if (isset($param['type']) && $param['type'] == 2) { $adminId = User::where(['id' => $this->userId])->with('company')->value('admin_id'); $where[] = ['check_admin_ids', '=', $adminId]; // 只有片区经理才能查看 } return $where; } public function lists(): array { return Approve::where($this->searchWhere) ->where($this->queryWhere()) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); } public function count(): int { return Approve::where($this->searchWhere)->count(); } }