Добвил контроллер для статистики Statisctics

parent a1df3c52
......@@ -263,9 +263,9 @@ return [
},
\App\Model\Statistics::class => function(ContainerInterface $container) {
return new \App\Model\Statistics(
$container->get(\App\Model\Sites::class),
$container->get(\App\Model\Zones::class),
$container->get('config')['country_codes']
//$container->get(\App\Model\Sites::class),
//$container->get(\App\Model\Zones::class),
//$container->get('config')['country_codes']
);
},
],
......
This diff is collapsed.
......@@ -58,6 +58,9 @@ class Cabinet extends Common
function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
{
/** @var \App\Model\Statistics $stats */
$stats = $this->container->get(Statistics::class);
if($request->getMethod() == 'POST') {
try {
......@@ -109,7 +112,8 @@ class Cabinet extends Common
$statsDaysModel = $this->container->get(StatsDays::class);
//$stats = $statsDaysModel->findAll(['FeedID' => $feed_id_list])->toArray();
$periodStats = $statsDaysModel->getStatsByDate($feed_id_list, $dates);
$campaignStats = $statsDaysModel->getStatsByFeeds($feed_id_list, $dates);
$stat = $stats->getStatData($metric, $type);
//$campaignStats = $statsDaysModel->getStatsByFeeds($feed_id_list, $dates);
$cats = [
'shows' => 'Показы',
......@@ -119,6 +123,7 @@ class Cabinet extends Common
'admoney' => 'admoney'
];
/*
if ($campaignStats || count($campaignStats['period'])>0) {
$feeds_names = [];
foreach($campaignStats['period'] as $feed_id) {
......@@ -127,6 +132,7 @@ class Cabinet extends Common
}
$campaignStats['period'] = $feeds_names;
}
*/
break;
case 'transaction':
......@@ -165,8 +171,9 @@ class Cabinet extends Common
$data['report'] = $report_type;
$data['current_period'] = $current_period;
$data['dates'] = $dates;
$data['stat'] = $stat;
$data['periodStats'] = $periodStats;
$data['campaignStats'] = $campaignStats;
//$data['campaignStats'] = $campaignStats;
$data['cats'] = $cats;
$data['periods_list'] = $this->container->get('config')['feed_conf']['periods_list'];
$data['colors_active_lines'] = $this->container->get('config')['feed_conf']['colors_active_lines'];
......
This diff is collapsed.
......@@ -152,6 +152,8 @@ $system_link = $this->url('adm.system.actions');
<div id="chart-graph-stat" style="height: 370px;" data-colors=<?= ($colors_active_lines ? json_encode($colors_active_lines) : '')?>></div>
<?php endif ?>
<?php print_r($stat); ?>
<?php /* Таблица */ ?>
<div id="table-stat" class="b-table_wrapp">
<div class="b-content__loading"></div>
......@@ -160,7 +162,7 @@ $system_link = $this->url('adm.system.actions');
<tr>
<th>
<?php if($report == 'common'): ?>
<b class="main-cat date selected"><?= _t('Дата')?></b> / <b class="main-cat campaign"><?= _t('Кампания')?></b>
<b class="main-cat date selected"><?= _t('Дата')?></b><?php /* ?> / <b class="main-cat campaign"><?= _t('Кампания')?></b><?php */ ?>
<?php else: ?>
<b class="main-cat date selected"><?= _t('Транзакция')?></b>
<?php endif; ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment