Kaynağa Gözat

OrderShopStore : ajout filter isDeliveryHome & isDeliveryPointSale

develop
Guillaume Bourgeois 1 yıl önce
ebeveyn
işleme
4cd567c91b
2 değiştirilmiş dosya ile 19 ekleme ve 0 silme
  1. +11
    -0
      Repository/Order/OrderShopRepositoryQuery.php
  2. +8
    -0
      Repository/Order/OrderShopStore.php

+ 11
- 0
Repository/Order/OrderShopRepositoryQuery.php Dosyayı Görüntüle

@@ -6,6 +6,7 @@ use Knp\Component\Pager\PaginatorInterface;
use Lc\CaracoleBundle\Model\Address\AddressInterface;
use Lc\CaracoleBundle\Model\Distribution\DistributionInterface;
use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface;
use Lc\CaracoleBundle\Model\Order\OrderShopModel;
use Lc\CaracoleBundle\Model\Product\ProductInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface;
@@ -88,6 +89,16 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery
->select('count(DISTINCT(orderShop.id)) as total');
}

public function filterIsDeliveryHome(): self
{
return $this->andWhere('.deliveryType = :deliveryType')->setParameter('deliveryType', OrderShopModel::DELIVERY_TYPE_HOME);
}

public function filterIsDeliveryPointSale(): self
{
return $this->andWhere('.deliveryType = :deliveryType')->setParameter('deliveryType', OrderShopModel::DELIVERY_TYPE_POINTSALE);
}

public function joinUser(): self
{
if (!$this->isJoinUser) {

+ 8
- 0
Repository/Order/OrderShopStore.php Dosyayı Görüntüle

@@ -388,6 +388,14 @@ class OrderShopStore extends AbstractStore

protected function applyGetByFilters(array $params, $query)
{
if (isset($params['isDeliveryHome']) && $params['isDeliveryHome']) {
$query->filterIsDeliveryHome();
}

if (isset($params['isDeliveryPointSale']) && $params['isDeliveryPointSale']) {
$query->filterIsDeliveryPointSale();
}

if (isset($params['isMerchantOnline'])) {
$query->filterIsMerchantOnline();
}

Yükleniyor…
İptal
Kaydet