def METHOD_NAME(self, queryset):
    """设置角色的用户绑定数量，以减少查询"""
    ids = [role.id for role in queryset]
    queryset = Role.objects.filter(id__in=ids).order_by(*self.ordering)
    org_id = current_org.id
    q = Q(role__scope=Role.Scope.system) | Q(role__scope=Role.Scope.org, org_id=org_id)
    role_bindings = RoleBinding.objects.filter(q).values_list('role_id').annotate(user_count=Count('user_id'))
    role_user_amount_mapper = {role_id: user_count for role_id, user_count in role_bindings}
    queryset = queryset.annotate(permissions_amount=Count('permissions'))
    queryset = list(queryset)
    for role in queryset:
        role.users_amount = role_user_amount_mapper.get(role.id, 0)
    return queryset