1
$categories= array(3,20,24);
$qb = $this->em->createQueryBuilder();
$qb->select('p')
->from('\Entities\Productss', 'p')
->leftJoin('p.category', 'c')
->andWhere('p.id =?1')
->andWhere('p.id =?2')
->andWhere('p.id =?2')
->setParameter(1, $categories[0])
->setParameter(2, $categories[1])
->setParameter(3, $categories[2])
->getQuery();
,這並不讓多個何在2查詢...學說,如果產品等於多個類別
$類是由它必須以正確的選擇匹配的產品類別的數組。如鞋子(3),黑色(20),小(24)
可能嗎?
$ QB-> EXPR() - >在()。是說,Id在1或2或3。我需要知道它是否在1和2和3 –