ソースを参照

Export par véhicules

feature/export_comptable
Fab 4年前
コミット
3b3f61579a
2個のファイルの変更22行の追加0行の削除
  1. +19
    -0
      ShopBundle/Repository/OrderShopRepository.php
  2. +3
    -0
      ShopBundle/Services/CsvGenerator.php

+ 19
- 0
ShopBundle/Repository/OrderShopRepository.php ファイルの表示

@@ -120,6 +120,10 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt
$query->select('count(e.id)');
}

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

if (isset($params['dateStart']) || isset($params['dateEnd'])) {
$params['dateField'] = isset($params['dateField']) ? $params['dateField'] : 'validationDate';
}
@@ -161,6 +165,17 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt
$query->andWhere('e.deliveryAddress = :address OR e.invoiceAddress = :address')->setParameter('address', $params['address']);
}

if(isset($params['weekDeliveryTruck'])) {
$query->andWhere('e.weekDeliveryTruck = :weekDeliveryTruck')->setParameter('weekDeliveryTruck', $params['weekDeliveryTruck']);
}

if(isset($params['deliveryDate'])) {
$query->andWhere('e.deliveryDate >= :deliveryDateStart');
$query->andWhere('e.deliveryDate < :deliveryDateEnd');
$query->setParameter('deliveryDateStart', $params['deliveryDate']->format('Y-m-d 00:00:00'));
$query->setParameter('deliveryDateEnd', $params['deliveryDate']->modify('+1 day')->format('Y-m-d 00:00:00'));
}

if (isset($params['mergeComplementaryOrderShops'])) {
$query->andWhere('e.mainOrderShop IS NULL');
$query->leftJoin('e.complementaryOrderShops', 'complementaryOrderShops');
@@ -229,6 +244,10 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt
}


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

if (isset($params['count']) && $params['count']) {
return $query->getQuery()->getSingleScalarResult();
} else {

+ 3
- 0
ShopBundle/Services/CsvGenerator.php ファイルの表示

@@ -45,4 +45,7 @@ class CsvGenerator






}

読み込み中…
キャンセル
保存