开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜