createQueryBuilder('e'); $qb->andWhere('e.product = :product'); $qb->andWhere('e.redelivery = false OR e.redelivery IS NULL'); $qb->setParameter('product', $product); $qb->leftJoin('e.orderShop', 'orderShop'); $qb->andWhere('orderShop.merchant = :currentMerchant'); $qb->setParameter('currentMerchant', $this->merchantUtils->getMerchantCurrent()); $qb->leftJoin('orderShop.orderStatus', 'orderStatus'); $qb->andWhere('orderStatus.alias IN (:alias)'); $qb->setParameter('alias',OrderStatus::ALIAS_CART); return $qb->getQuery()->getResult(); } }