Преглед на файлове

[Administration] Statistiques > Rapports : intégration des distributions non activées avec commandes

feature/souke
Guillaume Bourgeois преди 9 месеца
родител
ревизия
5fdd026ea5
променени са 3 файла, в които са добавени 15 реда и са изтрити 1 реда
  1. +1
    -1
      backend/controllers/ReportController.php
  2. +8
    -0
      domain/Distribution/Distribution/DistributionRepository.php
  3. +6
    -0
      domain/Distribution/Distribution/DistributionRepositoryQuery.php

+ 1
- 1
backend/controllers/ReportController.php Целия файл

@@ -94,7 +94,7 @@ class ReportController extends BackendController
}

$distributionsByMonthArray = [];
$distributionsArray = $distributionModule->findDistributionsActive();
$distributionsArray = $distributionModule->findDistributionsWithOrders();
foreach ($distributionsArray as $distribution) {
$month = date('Y-m', strtotime($distribution->date));
if (!isset($distributionsByMonthArray[$month])) {

+ 8
- 0
domain/Distribution/Distribution/DistributionRepository.php Целия файл

@@ -71,6 +71,14 @@ class DistributionRepository extends AbstractRepository
->find();
}

public function findDistributionsWithOrders()
{
return $this->createDefaultQuery()
->filterHasOrders()
->orderBy('date ASC')
->find();
}

/**
* Récupère les distributions futures.
*/

+ 6
- 0
domain/Distribution/Distribution/DistributionRepositoryQuery.php Целия файл

@@ -28,6 +28,12 @@ class DistributionRepositoryQuery extends AbstractRepositoryQuery
return $this;
}

public function filterHasOrders(): self
{
$this->innerJoinWith('order');
return $this;
}

public function filterByDateBetterThanToday(): self
{
$this->query

Loading…
Отказ
Запис