Quellcode durchsuchen

test orderShop

packProduct
Charly vor 3 Jahren
Ursprung
Commit
2194c1bae2
2 geänderte Dateien mit 17 neuen und 17 gelöschten Zeilen
  1. +9
    -9
      Repository/Order/OrderShopRepositoryQuery.php
  2. +8
    -8
      Repository/Order/OrderShopStore.php

+ 9
- 9
Repository/Order/OrderShopRepositoryQuery.php Datei anzeigen

@@ -45,7 +45,7 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery
public function selectCount(): self
{
return $this
->addSelect('count(r.id) as total');
->select('count(r.id) as total');
}

public function filterByUser(UserInterface $user): self
@@ -69,28 +69,28 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery
->setParameter('dateEnd', $dateEnd);
}

public function filterByEstimatedDeliveryDateStart(DateTime $dateStart): self
public function filterByEstimatedDeliveryDateStart(string $dateStart): self
{
return $this
->andWhere('.estimatedDeliveryDateTime >= :deliveryDateStart')
->setParameter('deliveryDateStart', $dateStart);
}

public function filterByEstimatedDeliveryDateEnd(DateTime $dateEnd): self
public function filterByEstimatedDeliveryDateEnd(string $dateEnd): self
{
return $this
->andWhere('.estimatedDeliveryDateTime < :deliveryDateEnd')
->setParameter('deliveryDateEnd', $dateEnd);
}

public function filterByDeliveryDateStart(DateTime $dateStart): self
public function filterByDeliveryDateStart(string $dateStart): self
{
return $this
->andWhere('.deliveryDate >= :deliveryDateStart')
->setParameter('deliveryDateStart', $dateStart);
}

public function filterByDeliveryDateEnd(DateTime $dateEnd): self
public function filterByDeliveryDateEnd(string $dateEnd): self
{
return $this
->andWhere('.deliveryDate < :deliveryDateEnd')
@@ -145,11 +145,11 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery
->setParameter('reductionCart', $reductionCart);
}

public function filterByAvailabilityPointZone(DeliveryAvailabilityZone $deliveryAvailabilityZone): self
public function filterByAvailabilityPointZone(DeliveryAvailabilityPointSale $deliveryAvailabilityPointSale): self
{
return $this
->andWhere('.deliveryAvailabilityZone = :deliveryAvailabilityZone')
->setParameter('deliveryAvailabilityZone', $deliveryAvailabilityZone);
->andWhere('.deliveryAvailabilityPointSale = :deliveryAvailabilityPointSale')
->setParameter('deliveryAvailabilityPointSale', $deliveryAvailabilityPointSale);
}

public function filterByAvailabilityPointSale(DeliveryAvailabilityPointSale $deliveryAvailabilityPointSale): self
@@ -297,7 +297,7 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery

public function joinDeliverySlotPointSale(): self
{
$this->joinDeliveryAvailabilityZone();
$this->joinDeliveryAvailabilityPointSale();

if (!$this->isJoinDeliverySlotPointSale) {
$this->isJoinDeliverySlotPointSale = true;

+ 8
- 8
Repository/Order/OrderShopStore.php Datei anzeigen

@@ -2,6 +2,8 @@

namespace Lc\CaracoleBundle\Repository\Order;

use App\Entity\Delivery\DeliveryAvailabilityPointSale;
use App\Entity\Delivery\DeliveryAvailabilityZone;
use App\Entity\Order\OrderStatus;
use Lc\CaracoleBundle\Builder\File\DocumentBuilder;
use Lc\CaracoleBundle\Factory\File\DocumentFactory;
@@ -352,10 +354,10 @@ class OrderShopStore extends AbstractStore

if (isset($params['count']) && $params['count']) {
$query->selectCount();
}
if (isset($params['select'])) {
$query->selectParam($params['select']);
} else {
if (isset($params['select'])) {
$query->selectParam($params['select']);
}
}

if (isset($params['dateStart']) || isset($params['dateEnd'])) {
@@ -461,10 +463,8 @@ class OrderShopStore extends AbstractStore
}

if (isset($params['orderBy'])) {
$query->orderBy(
$params['orderBy'],
isset($params['orderByDirection']) ? $params['orderByDirection'] : 'DESC'
);
$sort = isset($params['orderByDirection']) ? $params['orderByDirection'] : 'DESC';
$query->orderBy($params['orderBy'], $sort);
} else {
$query->orderBy('.id', 'DESC');
}

Laden…
Abbrechen
Speichern