0
我需要成績單這種要求的原則下symfon:具體的SQL查詢主義翻譯
SELECT node.name
FROM nested_category AS node,
nested_category AS parent
WHERE node.lft BETWEEN parent.lft AND parent.rgt
AND parent.name = 'ELECTRONICS'
ORDER BY node.lft;
我嘗試這一點,但它不工作:
$nodesDQL = $this->createQueryBuilder('childs')
->select('childs')
->from('AppBundle:NestedCategory', 'parent')
->join('AppBundle:NestedCategory', 'childs')
->where(new BetweenExpression('childs.lft', 'parent.lft', 'parent.right'))
->andWhere('parent = :parent')
->setParameter('parent', $node);
我可以」像這樣加入,任何想法都歡迎!
我想到subrequest,但在教條中如何?
問候。 PS:我英語不好,英語有困難。
我想我需要使用學說關係並添加更多信息,如深度或父母的ID? –