소스 검색

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






}

Loading…
취소
저장