瀏覽代碼

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

feature/souke
Guillaume Bourgeois 1 年之前
父節點
當前提交
796b5b0964
共有 2 個文件被更改,包括 3 次插入4 次删除
  1. +1
    -2
      backend/controllers/StatsAdminController.php
  2. +2
    -2
      common/logic/Order/Order/Repository/OrderRepository.php

+ 1
- 2
backend/controllers/StatsAdminController.php 查看文件

@@ -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 查看文件

@@ -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();

Loading…
取消
儲存