Добавил в конфиг отчетов параметры запросов к API

parent 66fc9497
......@@ -29,6 +29,8 @@ return [
'reports' => [
'common' => [
'title' => 'Сводный отчет',
'type' => 'feed_stat',
'fields' => ['Views','Clicks','Orders','OrderSum'],
'cats' => [
'Views' => 'Показы',
'Clicks' => 'Клики',
......@@ -39,6 +41,8 @@ return [
],
'transaction' => [
'title' => 'Транзакции',
'type' => 'feed_stat',
'fields' => ['Views','Clicks','Orders','OrderSum'],
'cats' => [
'Views' => 'Показы',
'Clicks' => 'Клики',
......
......@@ -130,13 +130,12 @@ class Cabinet extends Common
}
$data['feeds'] = $feeds;
$data['report'] = $report_type;
$data['current_report'] = $report_type;
$data['current_period'] = $current_period;
$data['dates'] = $dates;
$data['periodStats'] = $periodStats;
//$data['campaignStats'] = $campaignStats;
$data['report_conf'] = $report_conf;
//$data['cats'] = $report_conf['cats'];
$data['reports_list'] = $reports_list;
$data['periods_list'] = $this->container->get('config')['feed_conf']['periods_list'];
$data['colors_active_lines'] = $this->container->get('config')['feed_conf']['colors_active_lines'];
......
......@@ -38,12 +38,12 @@ class Statistics
// Параметры запроса по типу отчета:
switch ($report_type) {
case 'common':
$type = 'feed_stat';
$fields = ['Views','Clicks','Orders','OrderSum'];
$type = $report_conf['type'];
$fields = $report_conf['fields'];
break;
case 'transaction':
$type = 'feed_stat';
$fields = ['Views','Clicks','Orders','OrderSum'];
$type = $report_conf['type'];
$fields = $report_conf['fields'];
break;
}
......
......@@ -61,7 +61,7 @@ if (!$error) {
//$campaignStats = $this->campaignStats;
$current_period = $this->current_period;
$dates = $this->dates;
$report = $this->report;
$current_report = $this->current_report;
$report_conf = $this->report_conf;
$report_title = $report_conf['title'];
$report_cats = $report_conf['cats'];
......@@ -69,7 +69,7 @@ if (!$error) {
$periods_list = $this->periods_list;
$colors_active_lines = $this->colors_active_lines;
$data_request_link = $this->url('user.cabinet', ['lang' => $this->lang, 'report' => $report]);
$data_request_link = $this->url('user.cabinet', ['lang' => $this->lang, 'report' => $current_report]);
$system_link = $this->url('adm.system.actions');
}
......@@ -125,7 +125,7 @@ if (!$error) {
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu">
<?php foreach($reports_list as $report_name => $report_title): ?>
<li><a href="<?= $this->url('user.cabinet', ['lang' => $this->lang, 'report' => $report_name]) ?>" <?php if($report == $report_name): ?>class="current"<?php endif; ?> report="<?= $report_name ?>"><?= _t($report_title) ?></a></li>
<li><a href="<?= $this->url('user.cabinet', ['lang' => $this->lang, 'report' => $report_name]) ?>" <?php if($current_report == $report_name): ?>class="current"<?php endif; ?> report="<?= $report_name ?>"><?= _t($report_title) ?></a></li>
<?php endforeach; ?>
</ul>
</div>
......@@ -157,7 +157,7 @@ if (!$error) {
</div>
<?php /* График */ ?>
<?php if ($report == 'common'): ?>
<?php if ($current_report == 'common'): ?>
<div id="chart-graph-stat" style="height: 370px;" data-colors=<?= ($colors_active_lines ? json_encode($colors_active_lines) : '')?>></div>
<?php endif ?>
......@@ -168,7 +168,7 @@ if (!$error) {
<thead class="metric sortable">
<tr>
<th>
<?php if($report == 'common'): ?>
<?php if($current_report == 'common'): ?>
<b class="main-cat date selected"><?= _t('Дата')?></b>
<?php /* ?>/ <b class="main-cat campaign"><?= _t('Кампания')?></b><?php */ ?>
<?php else: ?>
......@@ -177,7 +177,7 @@ if (!$error) {
</th>
<?php foreach($report_cats as $name => $title): ?>
<th>
<?php if ($report == 'common'): ?>
<?php if ($current_report == 'common'): ?>
<span style="border-color: <?= $colors_active_lines[$name] ?>;">
<input type="checkbox" data-field="<?= $name ?>" checked />
</span>
......
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