浏览代码

countValidOrderShopsByDeliveryAvailability

feature/export_comptable
Guillaume 4 年前
父节点
当前提交
6b6e276b17
共有 3 个文件被更改,包括 19 次插入2 次删除
  1. +17
    -0
      ShopBundle/Repository/OrderShopRepository.php
  2. +1
    -1
      ShopBundle/Resources/views/backend/default/list-fields/field_price.html.twig
  3. +1
    -1
      ShopBundle/Resources/views/backend/default/list-fields/field_total.html.twig

+ 17
- 0
ShopBundle/Repository/OrderShopRepository.php 查看文件

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

namespace Lc\ShopBundle\Repository;

use App\Entity\DeliveryAvailabilityPointSale;
use App\Entity\DeliveryAvailabilityZone;
use Doctrine\ORM\QueryBuilder;
use Lc\ShopBundle\Context\DefaultRepositoryInterface;
use Lc\ShopBundle\Context\OrderShopInterface;
@@ -181,6 +183,21 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt
$query->andWhere('pointSale.isDepository = 1');
}

if (isset($params['deliveryAvailability'])) {
$deliveryAvailability = $params['deliveryAvailability'] ;

$isDeliveryAvailabilityZone = ($deliveryAvailability instanceof DeliveryAvailabilityZone) ? true : false;
$isDeliveryAvailabilityPointSale = ($deliveryAvailability instanceof DeliveryAvailabilityPointSale) ? true : false;

if($isDeliveryAvailabilityZone) {
$query->innerJoin('e.deliveryAvailabilityZone','deliveryAvailabilityZone') ;
}

if($isDeliveryAvailabilityPointSale) {
$query->innerJoin('e.deliveryAvailabilityPointSale','deliveryAvailabilityPointSale') ;
}
}

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

+ 1
- 1
ShopBundle/Resources/views/backend/default/list-fields/field_price.html.twig 查看文件

@@ -1 +1 @@
{{ priceUtils.getPriceWithTax(item) }}
{{ priceUtils.getPriceWithTax(item)|format_price|raw }}

+ 1
- 1
ShopBundle/Resources/views/backend/default/list-fields/field_total.html.twig 查看文件

@@ -1 +1 @@
{{ priceUtils.getTotalWithTax(item) }}
{{ priceUtils.getTotalWithTax(item)|format_price|raw }}

正在加载...
取消
保存