Pārlūkot izejas kodu

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

feature/souke
Guillaume Bourgeois pirms 9 mēnešiem
vecāks
revīzija
5fdd026ea5
3 mainītis faili ar 15 papildinājumiem un 1 dzēšanām
  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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt