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