Browse Source

[Administration] Tableau de bord administrateur

feature/souke
Guillaume Bourgeois 9 months ago
parent
commit
cfded52661
2 changed files with 5 additions and 4 deletions
  1. +2
    -2
      backend/controllers/DashboardAdminController.php
  2. +3
    -2
      domain/Order/Order/OrderRepository.php

+ 2
- 2
backend/controllers/DashboardAdminController.php View File

'countUsersOnline' => $this->getUserModule()->getRepository()->countUsersOnline(), 'countUsersOnline' => $this->getUserModule()->getRepository()->countUsersOnline(),
'countTicketsAdminOpen' => $this->getTicketModule()->getRepository()->countTicketsAdminStatusOpen(), 'countTicketsAdminOpen' => $this->getTicketModule()->getRepository()->countTicketsAdminStatusOpen(),
'countTicketsAdminUnread' => $this->getTicketModule()->getRepository()->countTicketsAdminUnreadByUser($this->getUserCurrent()), 'countTicketsAdminUnread' => $this->getTicketModule()->getRepository()->countTicketsAdminUnreadByUser($this->getUserCurrent()),
'statisticsCacheHtml' => \Yii::$app->cache->get('dashboard_statistics') ?: ''
'statisticsCacheHtml' => \Yii::$app->cache->get('dashboard_statistics5') ?: ''
]); ]);
} }




public function actionAjaxStatisticsHtml() public function actionAjaxStatisticsHtml()
{ {
return \Yii::$app->cache->getOrSet('dashboard_statistics', function () {
return \Yii::$app->cache->getOrSet('dashboard_statistics5', function () {
$producerModule = $this->getProducerModule(); $producerModule = $this->getProducerModule();
$pointSaleModule = $this->getPointSaleModule(); $pointSaleModule = $this->getPointSaleModule();
$userModule = $this->getUserModule(); $userModule = $this->getUserModule();

+ 3
- 2
domain/Order/Order/OrderRepository.php View File

public function getTurnoverLastThirtyDays() public function getTurnoverLastThirtyDays()
{ {
$now = new \DateTime(); $now = new \DateTime();

return $this->getTurnoverByDateStartEnd( return $this->getTurnoverByDateStartEnd(
$now,
$now->modify('-30 days')
$now->modify('-30 days'),
$now
); );
} }



Loading…
Cancel
Save