|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
-
-
-
- namespace backend\controllers;
-
- use yii\filters\AccessControl;
- use yii\filters\VerbFilter;
-
-
- class DashboardController extends BackendController
- {
-
-
- public function behaviors()
- {
- return [
- 'access' => [
- 'class' => AccessControl::class,
- 'rules' => [
- [
- 'allow' => true,
- 'roles' => ['@'],
- 'matchCallback' => function ($rule, $action) {
- return $this->getUserManager()->hasAccessBackend();
- }
- ],
- ],
- ],
- 'verbs' => [
- 'class' => VerbFilter::class,
- 'actions' => [
- ],
- ],
- ];
- }
-
-
-
- public function actionIndex()
- {
- return $this->render('index', [
- 'producer' => $this->getProducerCurrent(),
- 'productsCount' => $this->getProductContainer()->getRepository()->countProducts(),
- 'pointsSaleCount' => $this->getPointSaleContainer()->getRepository()->countPointSales(),
- 'distributionsArray' => $this->getDistributionContainer()->getRepository()->findDistributionsDashboard(),
- 'ordersArray' => $this->getOrderContainer()->getRepository()->findOrdersDashboard(),
- ]);
- }
- }
|