浏览代码

[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

正在加载...
取消
保存