我编写了以下查询构建器语句,但它始终返回 null,除非我删除“andWhere”子句。有任何想法吗?
$userQuery = $usersRepo->createQueryBuilder('u', 'ud')
->select('u.id')
->from('Test\Bundle\Entity\UserDetails', 'ud')
->where('u.userdetailsid = ud.id')
->andWhere('ud.passwordtoken = :tokenid')
->setParameter('tokenid', $em->createQueryBuilder()->expr()->literal($tokenid))
->getQuery();
$test = $userQuery->execute();