瀏覽代碼

test orderShop

packProduct
Charly 3 年之前
父節點
當前提交
2194c1bae2
共有 2 個檔案被更改,包括 17 行新增17 行删除
  1. +9
    -9
      Repository/Order/OrderShopRepositoryQuery.php
  2. +8
    -8
      Repository/Order/OrderShopStore.php

+ 9
- 9
Repository/Order/OrderShopRepositoryQuery.php 查看文件

@@ -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 查看文件

@@ -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');
}

Loading…
取消
儲存