我正在尝试使查询返回结果
select s.code
from clients as c
inner join clients_records as cr
on c.id = cr.id_client
inner join clients_survey_records as csr
on cr.id = csr.id
inner join surveys as s
on s.id = csr.id_survey
where c.id = 50939
order by s.id DESC
limit 1;
在学说中
$results = $qb->select($fields)
->from('Encueston\Entity\Client', 'c')
->innerJoin('Encueston\Entity\AbstractClientRecord', 'cr', 'WITH', 'c.id = cr.id')
->innerJoin('Encueston\Entity\ClientSurveyRecord', 'csr', 'WITH', 'cr.id = csr.id')
->innerJoin('Encueston\Entity\AbstractSurvey', 's', 'WITH', 's.id = csr.survey')
->where('c.id = :id_client')
->setParameter('id_client', $id)
->orderBy('cr.updatedAt','DESC')
->getQuery()
->getResult();
但我得到的结果为空