左JOIN语句中的SELECT语句与SYMFONY中的条令?

左JOIN语句中的SELECT语句与SYMFONY中的条令?,join,symfony1,doctrine,Join,Symfony1,Doctrine,是否有任何方法可以使用symfony在条令中运行此sql查询 $q = "SELECT a.id as app_id, b.title as gameTitle FROM application a LEFT JOIN application_translation b on a.id=b.id LEFT OUTER JOIN (SELECT m.application_id as m_id, count(m.member_id) as total FROM memb

是否有任何方法可以使用symfony在条令中运行此sql查询

$q = "SELECT a.id as app_id, b.title as gameTitle FROM application a 
    LEFT JOIN application_translation b on a.id=b.id 
    LEFT OUTER JOIN (SELECT m.application_id as m_id, count(m.member_id) as total
    FROM member_application m GROUP BY m.application_id) x on x.m_id = a.id 
    WHERE a.is_active=1 AND a.is_mobile = 1
    ORDER BY x.total DESC";
更新

谢谢你的回复。只有一件事,我怎么能转换

对象(SFOutputEscaperarArrayCorlator)#524

对象(SFOutputEscaperatorDecorator)#560


通过使用你的代码?我想这是因为水合物模式,但我不太清楚。

您可以尝试这样执行原始SQL:

$q = "SELECT a.id as app_id, b.title as gameTitle FROM application a 
LEFT JOIN application_translation b on a.id=b.id 
LEFT OUTER JOIN (SELECT m.application_id as m_id, count(m.member_id) as total
FROM member_application m GROUP BY m.application_id) x on x.m_id = a.id 
WHERE a.is_active=1 AND a.is_mobile = 1
ORDER BY x.total DESC";
$doctrine = Doctrine_Manager::getInstance()->getCurrentConnection()->getDbh();
$result = $doctrine->query($q);