瀏覽代碼

Merge branch 'develop' of https://gitea.laclic.fr/Laclic/LcShopBundle into develop

feature/export_comptable
Fab 4 年之前
父節點
當前提交
beaa2f9b7a
共有 3 個文件被更改,包括 22 次插入9 次删除
  1. +5
    -0
      ShopBundle/Model/OrderStatus.php
  2. +15
    -7
      ShopBundle/Repository/OrderShopRepository.php
  3. +2
    -2
      ShopBundle/Resources/views/backend/order/macros.html.twig

+ 5
- 0
ShopBundle/Model/OrderStatus.php 查看文件

@@ -37,6 +37,11 @@ abstract class OrderStatus
self::ALIAS_DONE
] ;

static $statusAliasWaitingDelivery = [
self::ALIAS_WAITING_DELIVERY,
self::ALIAS_WAITING_DELIVERY_WITH_PAYMENT,
];

static $statusAliasAsCart = [
self::ALIAS_CART,
self::ALIAS_WAITING_PAYMENT_ONLINE,

+ 15
- 7
ShopBundle/Repository/OrderShopRepository.php 查看文件

@@ -65,20 +65,24 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt

public function filterOrderValid(?QueryBuilder $query): QueryBuilder
{
$query->leftJoin('e.orderStatus', 'os');
$query->andWhere('os.alias IN (:alias)');
$query->setParameter('alias', OrderStatus::$statusAliasAsValid);
return $this->_filterOrderStatus($query, OrderStatus::$statusAliasAsValid) ;
}

return $query;
public function filterOrderWaitingDelivery($query)
{
return $this->_filterOrderStatus($query, OrderStatus::$statusAliasWaitingDelivery) ;
}

public function filterOrderCart($query)
{
return $this->_filterOrderStatus($query, OrderStatus::$statusAliasAsCart) ;
}

private function _filterOrderStatus($query, $statusArray) {
$query->leftJoin('e.orderStatus', 'os');
$query->andWhere('os.alias IN (:alias)');
$query->setParameter('alias', OrderStatus::$statusAliasAsCart);

return $query;
$query->setParameter('alias',$statusArray);
return $query ;
}

public function findCartCurrent($params)
@@ -139,6 +143,10 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt
$query = $this->filterOrderValid($query);
}

if (isset($params['isWaitingDelivery'])) {
$query = $this->filterOrderWaitingDelivery($query);
}

if (isset($params['orderStatus'])) {
$query->leftJoin('e.orderStatus', 'os');
$query->andWhere('os.alias LIKE :alias');

+ 2
- 2
ShopBundle/Resources/views/backend/order/macros.html.twig 查看文件

@@ -301,11 +301,11 @@
{% block label %}{{ "field.default.deliveryAvailabilty"|trans({}, 'lcshop') }}{% endblock %}
{% block value %}
<div v-if="order.deliveryType == 'home'">
<div v-html="order.deliveryAvailabilityZone">
<div v-html="order.deliveryAvailabilityZone != null ? order.deliveryAvailabilityZone : order.deliveryDate">
</div>
</div>
<div v-else-if="order.deliveryType == 'point-sale'">
<div v-html="order.deliveryAvailabilityPointSale">
<div v-html="order.deliveryAvailabilityPointSale != null ? order.deliveryAvailabilityPointSale : order.deliveryDate">
</div>
</div>
<div v-else>

Loading…
取消
儲存