我有以下内容:
$sql = "SELECT s.userid
FROM app_instagram_shop s
WHERE s.expirydate IS NOT NULL
AND s.expirydate >= NOW()
AND s.isLocked = false
AND s.deletedAt IS NULL
ORDER BY s.updated ASC
LIMIT 5
";
$rsm = new \Doctrine\ORM\Query\ResultSetMappingBuilder($this->_em);
$rsm->addEntityResult('AppMainBundle:InstagramShop', 's');
$rsm->addFieldResult('s', 'userid', 'userid');
return $this->_em->createNativeQuery($sql, $rsm)->getResult();
知道为什么这不起作用?我得到了以下错误:
Undefined index: id in /var/www/App/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2432