|
|
@@ -9,6 +9,7 @@ use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Product\ProductInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface; |
|
|
|
use Lc\CaracoleBundle\Model\Section\SectionInterface; |
|
|
|
use Lc\CaracoleBundle\Model\User\VisitorInterface; |
|
|
|
use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait; |
|
|
|
use Lc\SovBundle\Model\User\UserInterface; |
|
|
@@ -32,6 +33,7 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery |
|
|
|
protected bool $isJoinDeliveryPointSale = false; |
|
|
|
protected bool $isJoinOrderPayment = false; |
|
|
|
protected bool $isFilteredByStatus = false; |
|
|
|
protected bool $isJoinMainOrderShop = false; |
|
|
|
|
|
|
|
public function __construct(OrderShopRepository $repository, PaginatorInterface $paginator) |
|
|
|
{ |
|
|
@@ -267,14 +269,21 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery |
|
|
|
|
|
|
|
public function filterIsNotComplementaryOrderShop(): self |
|
|
|
{ |
|
|
|
return $this |
|
|
|
->andWhere('.mainOrderShop = false OR .mainOrderShop IS NULL'); |
|
|
|
return $this->andWhere('.mainOrderShop = false OR .mainOrderShop IS NULL'); |
|
|
|
} |
|
|
|
|
|
|
|
public function filterIsComplementaryOrderShop(): self |
|
|
|
{ |
|
|
|
return $this->andWhere('.mainOrderShop = true OR .mainOrderShop IS NOT NULL'); |
|
|
|
} |
|
|
|
|
|
|
|
public function filterSectionMainOrderShop(SectionInterface $section) |
|
|
|
{ |
|
|
|
$this->joinMainOrderShop(); |
|
|
|
|
|
|
|
return $this |
|
|
|
->andWhere('.mainOrderShop = true OR .mainOrderShop IS NOT NULL'); |
|
|
|
->andWhere('mainOrderShop.section = :section') |
|
|
|
->setParameter('section', $section); |
|
|
|
} |
|
|
|
|
|
|
|
public function filterIsNullMainOrderShop(): self |
|
|
@@ -435,4 +444,15 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery |
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
public function joinMainOrderShop(): self |
|
|
|
{ |
|
|
|
if (!$this->isJoinMainOrderShop) { |
|
|
|
$this->isJoinMainOrderShop = true; |
|
|
|
|
|
|
|
return $this |
|
|
|
->leftJoin('.mainOrderShop', 'mainOrderShop'); |
|
|
|
} |
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
} |