php: doctrine 2 and innerJoin condition
I have problem with innerJoin.
Two tables range and product:
table range id parent_id category_id
table product
id
range_id
the query must join range.id with range2.chidren only level 1 and range, range2 with product
ex: range.id = product.range_id or range2.id = product.range_id:
I want something like :
INNER JOIN product p1_ ON p0_.id = p1_.range_id or p4_.id = p1_.range_id
with doctrine when I write :
->innerJoin('r.products', 'p', Expr\Join::WITH, 'r.id = p.range or rp.id = p.range ')
I got :
INNER JOIN product p1_ ON p0_.id = p1_.range_id AND (p0_.开发者_如何学运维id = p1_.range_id OR p4_.id = p1_.range_id)
someone have solution
精彩评论