Quellcode durchsuchen

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

feature/souke
Guillaume Bourgeois vor 9 Monaten
Ursprung
Commit
5fdd026ea5
3 geänderte Dateien mit 15 neuen und 1 gelöschten Zeilen
  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 Datei anzeigen

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

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

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

Laden…
Abbrechen
Speichern