Przeglądaj źródła

[Backend] Bons cadeau : adaptations

feature/module_traiteur_v1
Guillaume 4 lat temu
rodzic
commit
6db64c1e7a
2 zmienionych plików z 20 dodań i 8 usunięć
  1. +18
    -6
      ShopBundle/Repository/OrderShopRepository.php
  2. +2
    -2
      ShopBundle/Services/Order/OrderUtils.php

+ 18
- 6
ShopBundle/Repository/OrderShopRepository.php Wyświetl plik

@@ -196,29 +196,42 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt
}

$setParameterHorsTournee = false ;
$setParameterGiftVoucher = false ;

if (isset($params['isCircuit'])) {
if(isset($params['isCircuit'])) {
$query->leftJoin('e.deliveryPointSale', 'pointSale');
$query->andWhere('e.deliveryPointSale IS NULL OR (pointSale.isDepository = 0 AND (pointSale.devAlias IS NULL OR pointSale.devAlias != :devAliasHorsTournee))');
$query->andWhere('e.deliveryPointSale IS NULL OR (pointSale.isDepository = 0 AND (pointSale.devAlias IS NULL OR (pointSale.devAlias != :devAliasHorsTournee AND pointSale.devAlias != :devAliasGiftVoucher)))');
$setParameterHorsTournee = true ;
$setParameterGiftVoucher = true ;
}

if (isset($params['isDepository'])) {
if(isset($params['isDepository'])) {
$query->innerJoin('e.deliveryPointSale', 'pointSale');
$query->andWhere('pointSale IS NOT NULL AND pointSale.isDepository = 1 AND (pointSale.devAlias IS NULL OR pointSale.devAlias != :devAliasHorsTournee)');
$query->andWhere('pointSale IS NOT NULL AND pointSale.isDepository = 1 AND (pointSale.devAlias IS NULL OR (pointSale.devAlias != :devAliasHorsTournee AND pointSale.devAlias != :devAliasGiftVoucher))');
$setParameterHorsTournee = true ;
$setParameterGiftVoucher = true ;
}

if (isset($params['isOffCircuit'])) {
if(isset($params['isOffCircuit'])) {
$query->innerJoin('e.deliveryPointSale', 'pointSale');
$query->andWhere('pointSale IS NOT NULL AND pointSale.devAlias = :devAliasHorsTournee');
$setParameterHorsTournee = true ;
}

if(isset($params['isGiftVoucher'])) {
$query->innerJoin('e.deliveryPointSale', 'pointSale');
$query->andWhere('pointSale IS NOT NULL AND pointSale.devAlias = :devAliasGiftVoucher');
$setParameterGiftVoucher = true ;
}

if($setParameterHorsTournee) {
$query->setParameter('devAliasHorsTournee', 'horstournee') ;
}

if($setParameterGiftVoucher) {
$query->setParameter('devAliasGiftVoucher', 'giftvoucher') ;
}

if (isset($params['deliveryAvailability'])) {
$deliveryAvailability = $params['deliveryAvailability'] ;

@@ -249,7 +262,6 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt
$query->orderBy('e.id', 'DESC');
}


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

+ 2
- 2
ShopBundle/Services/Order/OrderUtils.php Wyświetl plik

@@ -177,7 +177,7 @@ class OrderUtils
$this->em->flush();
}

$this->eventOrderShopChangeQuantity($orderShop) ;
$this->eventCartChange($orderShop) ;
}
}
else {
@@ -380,7 +380,7 @@ class OrderUtils
return $this->priceUtils->getTotalWithTax($orderShop) >= 0 ;
}

public function eventOrderShopChangeQuantity(OrderShopInterface $orderShop)
public function eventCartChange(OrderShopInterface $orderShop)
{

}

Ładowanie…
Anuluj
Zapisz