我编写了以下查询构建器语句但它总是返回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();