Bläddra i källkod

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

feature/export_comptable
Fab 4 år sedan
förälder
incheckning
beaa2f9b7a
3 ändrade filer med 22 tillägg och 9 borttagningar
  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 Visa fil

@@ -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 Visa fil

@@ -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 Visa fil

@@ -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>

Laddar…
Avbryt
Spara