src/PHPDish/Bundle/UserBundle/Twig/UserExtension.php
public function getCategoryAuthors($limit = 10)
    {
        $qb = $this->userManager->getUserRepository()->createQueryBuilder('u');

        return $qb->select('distinct u')
            ->innerJoin('u.categories', 'c')
            ->where('c.postCount > :postCount')->setParameter('postCount', 0)
            ->setMaxResults($limit)
            ->orderBy('u.updatedAt', 'desc')
            ->getQuery()
            ->getResult();
    }
public function getCategoryAuthors($limit = 10)
    {
        $qb = $this->userManager->getUserRepository()->createQueryBuilder('u');

        return $qb->select('distinct u')
            ->innerJoin('u.categories', 'c')
            ->where('c.postCount > :postCount')->setParameter('postCount', 0)
            ->setMaxResults($limit)
            ->orderBy('u.updatedAt', 'desc')
            ->getQuery()
            ->getResult();
    }
获取专栏作者

@param int $limit
@return UserInterface[]