Quellcode durchsuchen

[Administration] Statistiques admin : commandes clients des 30 derniers jours

feature/souke
Guillaume Bourgeois vor 1 Jahr
Ursprung
Commit
796b5b0964
2 geänderte Dateien mit 3 neuen und 4 gelöschten Zeilen
  1. +1
    -2
      backend/controllers/StatsAdminController.php
  2. +2
    -2
      common/logic/Order/Order/Repository/OrderRepository.php

+ 1
- 2
backend/controllers/StatsAdminController.php Datei anzeigen

@@ -78,10 +78,9 @@ class StatsAdminController extends BackendController
$period = new DatePeriod($start, $interval, $end);

foreach ($period as $date) {

$dateFormat = date('d/m/Y', $date->getTimestamp());
$dataLabels[] = $dateFormat;
$data[] = $orderManager->countOrdersByDateAndOrigin($date);
$data[] = $orderManager->countGlobalOrdersByDateAndOrigin($date);
}

return $this->render('index', [

+ 2
- 2
common/logic/Order/Order/Repository/OrderRepository.php Datei anzeigen

@@ -75,9 +75,9 @@ class OrderRepository extends AbstractRepository
->findOne();
}

public function countOrdersByDateAndOrigin(\DateTime $date, string $origin = Order::ORIGIN_USER)
public function countGlobalOrdersByDateAndOrigin(\DateTime $date, string $origin = Order::ORIGIN_USER)
{
return $this->createDefaultQuery()
return $this->createQuery()
->filterByDate($date)
->filterByOrigin($origin)
->count();

Laden…
Abbrechen
Speichern