['name', 'desc', 'menu_arr', 'sort'], ]; } /** * @notes 获取用户角色列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2023/08/23 09:38 */ public function lists(): array { return UserRole::where($this->searchWhere) ->field(['id', 'name', 'desc', 'menu_arr', 'sort']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); } /** * @notes 获取用户角色数量 * @return int * @author likeadmin * @date 2023/08/23 09:38 */ public function count(): int { return UserRole::where($this->searchWhere)->count(); } }