瀏覽代碼

Adaptations OrderShopStore

master
Guillaume 3 年之前
父節點
當前提交
214c7ae6a3
共有 2 個檔案被更改,包括 10 行新增4 行删除
  1. +3
    -3
      Repository/Order/OrderShopRepositoryQuery.php
  2. +7
    -1
      Repository/Order/OrderShopStore.php

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

@@ -152,11 +152,11 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery
->setParameter('year', $year);
}

public function filterByDistributions(array $distributions): self
public function filterByDistributions(array $distributionArray): self
{
return $this
->andWhere('.distribution IN(:distributions)')
->setParameter('distributions', $distributions);
->andWhere('.distribution IN (:distributions)')
->setParameter('distributions', $distributionArray);
}

public function filterByProducts(array $products): self

+ 7
- 1
Repository/Order/OrderShopStore.php 查看文件

@@ -89,7 +89,7 @@ class OrderShopStore extends AbstractStore

public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{
$query->orderBy('id', 'DESC');
//$query->orderBy('id', 'DESC');
return $query;
}

@@ -392,6 +392,10 @@ class OrderShopStore extends AbstractStore
$query->filterByDistribution($params['distribution']);
}

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

if (isset($params['isCart'])) {
$query->filterByStatus(OrderStatusModel::$statusAliasAsCart);
}
@@ -428,6 +432,7 @@ class OrderShopStore extends AbstractStore
if (isset($params['excludeComplementaryOrderShops']) || isset($params['mergeComplementaryOrderShops'])) {
$query->filterIsNullMainOrderShop();
}

if (isset($params['joinProductFamily'])) {
$query->joinProductFamily(true);
}
@@ -442,6 +447,7 @@ class OrderShopStore extends AbstractStore
if (isset($params['groupBy'])) {
$query->groupBy($params['groupBy']);
}

return $query;
}


Loading…
取消
儲存