Страница отчета по транзакциям

parent 7ba7fdd7
...@@ -160,31 +160,6 @@ return [ ...@@ -160,31 +160,6 @@ return [
$container->get(\Monolog\Logger::class) $container->get(\Monolog\Logger::class)
); );
}, },
\App\Model\Feeds\StatsDays::class => function (ContainerInterface $container) {
return new \App\Model\Feeds\StatsDays(
new Zend\Db\TableGateway\TableGateway(
'stats_day',
$container->get(Zend\Db\Adapter\AdapterRetarg::class),
new \Zend\Db\TableGateway\Feature\MetadataFeature(),
new \Zend\Db\ResultSet\HydratingResultSet($container->get(\Zend\Hydrator\DelegatingHydrator::class), new \App\Entity\Feeds\StatsDay())
),
$container->get(\Zend\Hydrator\DelegatingHydrator::class),
$container->get(\Monolog\Logger::class)
);
},
\App\Model\Feeds\Transactions::class => function (ContainerInterface $container) {
return new \App\Model\Feeds\Transactions(
new Zend\Db\TableGateway\TableGateway(
'transactions',
$container->get(Zend\Db\Adapter\AdapterRetarg::class),
new \Zend\Db\TableGateway\Feature\MetadataFeature(),
new \Zend\Db\ResultSet\HydratingResultSet($container->get(\Zend\Hydrator\DelegatingHydrator::class), new \App\Entity\Feeds\Transaction())
),
$container->get(\Zend\Hydrator\DelegatingHydrator::class),
$container->get(\Monolog\Logger::class)
);
},
\App\Model\FAQ\Categories::class => function (ContainerInterface $container) { \App\Model\FAQ\Categories::class => function (ContainerInterface $container) {
return new \App\Model\FAQ\Categories( return new \App\Model\FAQ\Categories(
new Zend\Db\TableGateway\TableGateway( new Zend\Db\TableGateway\TableGateway(
......
...@@ -32,8 +32,6 @@ use App\Model\Users; ...@@ -32,8 +32,6 @@ use App\Model\Users;
use App\Model\Statistics; use App\Model\Statistics;
use App\Model\Providers; use App\Model\Providers;
use App\Model\Feeds\Feeds; use App\Model\Feeds\Feeds;
use App\Model\Feeds\StatsDays;
use App\Model\Feeds\Transactions;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\HtmlResponse; use Zend\Diactoros\Response\HtmlResponse;
...@@ -108,11 +106,7 @@ class Cabinet extends Common ...@@ -108,11 +106,7 @@ class Cabinet extends Common
switch ($report_type) { switch ($report_type) {
case 'common': case 'common':
/** @var \App\Model\Feeds $statDaysModel */ $periodStats = $stats->getFeedStatData($report_type, $feed_id_list, $dates);
//$statsDaysModel = $this->container->get(StatsDays::class);
//$stats = $statsDaysModel->findAll(['FeedID' => $feed_id_list])->toArray();
//$periodStats = $statsDaysModel->getStatsByDate($feed_id_list, $dates);
$periodStats = $stats->getStatData($report_type, $feed_id_list, $dates);
$cats = [ $cats = [
'Views' => 'Показы', 'Views' => 'Показы',
...@@ -132,38 +126,28 @@ class Cabinet extends Common ...@@ -132,38 +126,28 @@ class Cabinet extends Common
]; ];
$campaignStats = $statsDaysModel->getStatsByFeeds($feed_id_list, $dates); $campaignStats = $statsDaysModel->getStatsByFeeds($feed_id_list, $dates);
if ($campaignStats || count($campaignStats['period'])>0) {
$feeds_names = [];
foreach($campaignStats['period'] as $feed_id) {
$feed = $feedsModel->findById($feed_id);
$feeds_names[] = $feed->getTitle();
}
$campaignStats['period'] = $feeds_names;
}
*/ */
break; break;
/*
case 'transaction': case 'transaction':
// @var \App\Model\Feeds $transactionsModel $periodStats = $stats->getFeedStatData($report_type, $feed_id_list, $dates);
$transactionsModel = $this->container->get(Transactions::class);
$transactionStats = $transactionsModel->getStatsByTransactions($feed_id_list, $dates); /*
$cats = [ $cats = [
'localmoney' => 'localmoney', 'localmoney' => 'localmoney',
'usdollarmoney' => 'usdollarmoney' 'usdollarmoney' => 'usdollarmoney'
]; ];
*/
if ($transactionStats || count($transactionStats['period'])>0) { $cats = [
$transactions_names = []; 'Views' => 'Показы',
foreach($transactionStats['period'] as $transaction_id) { 'Clicks' => 'Клики',
$transactions_names[] = 'транзакция #'.$transaction_id; 'Orders' => 'Заказы',
} 'OrderSum' => 'Заказы на сумму',
$transactionStats['period'] = $transactions_names; 'AdMoney' => 'Комиссия AddCPM'
} ];
$periodStats = $transactionStats;
break; break;
*/
default: default:
$data['error'] = _t('Извините, тип отчета "'. $report_type .'" недоступен'); $data['error'] = _t('Извините, тип отчета "'. $report_type .'" недоступен');
break; break;
...@@ -187,15 +171,6 @@ class Cabinet extends Common ...@@ -187,15 +171,6 @@ class Cabinet extends Common
$data['periods_list'] = $this->container->get('config')['feed_conf']['periods_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']; $data['colors_active_lines'] = $this->container->get('config')['feed_conf']['colors_active_lines'];
/*
$response = new HtmlResponse($this->template->render('app::user/feeds', [
'lang' => $request->getAttribute('layoutInfo')->getLang(),
'feeds' => $feeds,
'stats' => $stats,
]));
return $response;
*/
} catch(\Exception $e) { } catch(\Exception $e) {
$data['error'] = _t('Извините, статистика временно не работает'); $data['error'] = _t('Извините, статистика временно не работает');
} }
...@@ -206,7 +181,6 @@ class Cabinet extends Common ...@@ -206,7 +181,6 @@ class Cabinet extends Common
]); ]);
return new HtmlResponse($this->template->render('app::user/cabinet-feed', $data)); return new HtmlResponse($this->template->render('app::user/cabinet-feed', $data));
} }
} }
...@@ -239,37 +213,13 @@ class Cabinet extends Common ...@@ -239,37 +213,13 @@ class Cabinet extends Common
switch ($report_type) { switch ($report_type) {
case 'common': case 'common':
/** @var \App\Model\Feeds $statDaysModel */ $periodStats = $stats->getFeedStatData($report_type, $feed_id_list, $dates);
//$statsDaysModel = $this->container->get(StatsDays::class);
//$periodStats = $statsDaysModel->getStatsByDate($feed_id_list, $dates);
$periodStats = $stats->getStatData($report_type, $feed_id_list, $dates);
/* /*
$campaignStats = $statsDaysModel->getStatsByFeeds($feed_id_list, $dates); $campaignStats = $statsDaysModel->getStatsByFeeds($feed_id_list, $dates);
if ($campaignStats || count($campaignStats['period'])>0) {
$feeds_names = [];
foreach($campaignStats['period'] as $feed_id) {
$feed = $feedsModel->findById($feed_id);
$feeds_names[] = $feed->getTitle();
}
$campaignStats['period'] = $feeds_names;
}
*/ */
break; break;
case 'transaction': case 'transaction':
/** @var \App\Model\Feeds $transactionsModel */ $periodStats = $stats->getFeedStatData($report_type, $feed_id_list, $dates);
$transactionsModel = $this->container->get(Transactions::class);
$transactionStats = $transactionsModel->getStatsByTransactions($feed_id_list, $dates);
if ($transactionStats || count($transactionStats['period'])>0) {
$transactions_names = [];
foreach($transactionStats['period'] as $transaction_id) {
$transactions_names[] = 'транзакция #'.$transaction_id;
}
$transactionStats['period'] = $transactions_names;
}
$periodStats = $transactionStats;
break; break;
default: default:
$periodStats = null; $periodStats = null;
......
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace App\Entity\Feeds;
use App\Entity\Common;
/**
* Class StatsDay
* @package App\Entity
*/
class StatsDay extends Common
{
// FeedID
public function getFeedid()
{
return $this->feedid;
}
public function setFeedid($feedid)
{
$this->feedid = $feedid;
return $this;
}
// EventDate
public function getEventdate()
{
return $this->eventdate;
}
public function setEventdate($eventdate)
{
$this->eventdate = $eventdate;
return $this;
}
// Shows
public function getShows(): int
{
return $this->shows;
}
public function setShows($shows)
{
$this->shows = $shows;
return $this;
}
// Clicks
public function getClicks(): int
{
return $this->clicks;
}
public function setClicks($clicks)
{
$this->clicks = $clicks;
return $this;
}
// Transactions
public function getTransactions(): int
{
return $this->transactions;
}
public function setTransactions($transactions)
{
$this->transactions = $transactions;
return $this;
}
// Salemoney
public function getSalemoney(): float
{
return $this->salemoney;
}
public function setSalemoney($salemoney)
{
$this->salemoney = $salemoney;
return $this;
}
// Salemoney
public function getAdmoney(): float
{
return $this->admoney;
}
public function setAdmoney($admoney)
{
$this->admoney = $admoney;
return $this;
}
}
\ No newline at end of file
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace App\Entity\Feeds;
use App\Entity\Common;
/**
* Class StatsDay
* @package App\Entity
*/
class Transaction extends Common
{
// FeedID
public function getFeedid()
{
return $this->feedid;
}
public function setFeedid($feedid)
{
$this->feedid = $feedid;
return $this;
}
// EventDate
public function getEventdate()
{
return $this->eventdate;
}
public function setEventdate($eventdate)
{
$this->eventdate = $eventdate;
return $this;
}
// Transactionid
public function getTransactionid()
{
return $this->transactionid;
}
public function setTransactionid($transactionid)
{
$this->transactionid = $transactionid;
return $this;
}
// Foreignid
public function getForeignid()
{
return $this->foreignid;
}
public function setForeignid($foreignid)
{
$this->foreignid = $foreignid;
return $this;
}
// Currency
public function getCurrency()
{
return $this->currency;
}
public function setCurrency($currency)
{
$this->currency = $currency;
return $this;
}
// Localmoney
public function getLocalmoney(): float
{
return $this->localmoney;
}
public function setLocalmoney($localmoney)
{
$this->localmoney = $localmoney;
return $this;
}
// Usdollarmoney
public function getUsdollarmoney(): float
{
return $this->usdollarmoney;
}
public function setUsdollarmoney($usdollarmoney)
{
$this->usdollarmoney = $usdollarmoney;
return $this;
}
}
\ No newline at end of file
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace App\Model\Feeds;
use App\Model\Common;
/**
* Class StatsDays
* @package App\Model
*/
class StatsDays extends Common
{
public function getStatsByFeeds($feeds, $dates)
{
$adapter = $this->tableGateway->getAdapter();
$sql = 'SELECT FeedID, SUM(Shows) AS Shows, SUM(Clicks) AS Clicks, SUM(Transactions) AS Transactions, SUM(SaleMoney) AS SaleMoney, SUM(AdMoney) AS AdMoney'
. ' FROM ' . (string) $this->tableGateway->getTable()
. ' WHERE FeedID in (\''.implode('\',\'', $feeds).'\')'
. ' AND (EventDate BETWEEN "'.$dates[0].'" AND "'.$dates[1].'")'
. ' GROUP BY FeedID'
. ' ORDER BY FeedID';
$res = $adapter->query($sql, \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE);
$stats = array(
'period' => [],
'shows' => [],
'clicks' => [],
'transactions' => [],
'salemoney' => [],
'admoney' => [],
);
foreach($res as $stat_item) {
$stats['period'][] = $stat_item['FeedID'];
$stats['shows'][] = (int)$stat_item['Shows'];
$stats['clicks'][] = (int)$stat_item['Clicks'];
$stats['transactions'][] = (int)$stat_item['Transactions'];
$stats['salemoney'][] = (float)$stat_item['SaleMoney'];
$stats['admoney'][] = (float)$stat_item['AdMoney'];
}
return $stats;
}
public function getStatsByDate($feeds, $dates)
{
$adapter = $this->tableGateway->getAdapter();
$sql = 'SELECT EventDate, SUM(Shows) AS Shows, SUM(Clicks) AS Clicks, SUM(Transactions) AS Transactions, SUM(SaleMoney) AS SaleMoney, SUM(AdMoney) AS AdMoney'
. ' FROM ' . (string) $this->tableGateway->getTable()
. ' WHERE FeedID in (\''.implode('\',\'', $feeds).'\')'
. ' AND (EventDate BETWEEN "'.$dates[0].'" AND "'.$dates[1].'")'
. ' GROUP BY EventDate'
. ' ORDER BY EventDate desc';
$res = $adapter->query($sql, \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE);
if (count($res) == 0) {
return null;
}
$stats = array(
'period' => [],
'shows' => [],
'clicks' => [],
'transactions' => [],
'salemoney' => [],
'admoney' => [],
);
foreach($res as $stat_item) {
$stats['period'][] = $stat_item['EventDate'];
$stats['shows'][] = (int)$stat_item['Shows'];
$stats['clicks'][] = (int)$stat_item['Clicks'];
$stats['transactions'][] = (int)$stat_item['Transactions'];
$stats['salemoney'][] = (float)$stat_item['SaleMoney'];
$stats['admoney'][] = (float)$stat_item['AdMoney'];
}
return $stats;
}
}
\ No newline at end of file
<?php
/**
* Copyright (c) 2016 Serhii Borodai <clarifying@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
*/
namespace App\Model\Feeds;
use App\Model\Common;
/**
* Class Transactions
* @package App\Model
*/
class Transactions extends Common
{
public function getStatsByTransactions($feeds, $dates)
{
$adapter = $this->tableGateway->getAdapter();
$sql = 'SELECT TransactionID, SUM(LocalMoney) AS LocalMoney, SUM(USDollarMoney) AS USDollarMoney'
. ' FROM ' . (string) $this->tableGateway->getTable()
. ' WHERE FeedID in (\''.implode('\',\'', $feeds).'\')'
. ' AND (EventDate BETWEEN "'.$dates[0].'" AND "'.$dates[1].'")'
. ' GROUP BY TransactionID'
. ' ORDER BY TransactionID';
$res = $adapter->query($sql, \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE);
$stats = array(
'period' => [],
'localmoney' => [],
'usdollarmoney' => []
);
foreach($res as $stat_item) {
$stats['period'][] = $stat_item['TransactionID'];
$stats['localmoney'][] = (float)$stat_item['LocalMoney'];
$stats['usdollarmoney'][] = (float)$stat_item['USDollarMoney'];
}
return $stats;
}
public function getStatsByFeeds($feeds, $dates)
{
$adapter = $this->tableGateway->getAdapter();
$sql = 'SELECT FeedID, SUM(LocalMoney) AS LocalMoney, SUM(USDollarMoney) AS USDollarMoney'
. ' FROM ' . (string) $this->tableGateway->getTable()
. ' WHERE FeedID in (\''.implode('\',\'', $feeds).'\')'
. ' AND (EventDate BETWEEN "'.$dates[0].'" AND "'.$dates[1].'")'
. ' GROUP BY FeedID'
. ' ORDER BY FeedID';
$res = $adapter->query($sql, \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE);
$stats = array(
'period' => [],
'localmoney' => [],
'usdollarmoney' => []
);
foreach($res as $stat_item) {
$stats['period'][] = $stat_item['FeedID'];
$stats['localmoney'][] = (float)$stat_item['LocalMoney'];
$stats['usdollarmoney'][] = (float)$stat_item['USDollarMoney'];
}
return $stats;
}
public function getStatsByDate($feeds, $dates)
{
$adapter = $this->tableGateway->getAdapter();
$sql = 'SELECT EventDate, SUM(LocalMoney) AS LocalMoney, SUM(USDollarMoney) AS USDollarMoney'
. ' FROM ' . (string) $this->tableGateway->getTable()
. ' WHERE FeedID in (\''.implode('\',\'', $feeds).'\')'
. ' AND (EventDate BETWEEN "'.$dates[0].'" AND "'.$dates[1].'")'
. ' GROUP BY EventDate'
. ' ORDER BY EventDate desc';
$res = $adapter->query($sql, \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE);
if (count($res) == 0) {
return null;
}
$stats = array(
'period' => [],
'localmoney' => [],
'usdollarmoney' => []
);
foreach($res as $stat_item) {
$stats['period'][] = $stat_item['EventDate'];
$stats['localmoney'][] = (float)$stat_item['LocalMoney'];
$stats['usdollarmoney'][] = (float)$stat_item['USDollarMoney'];
}
return $stats;
}
}
\ No newline at end of file
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
namespace App\Model; namespace App\Model;
use DateTime; use DateTime;
//use App\Model\Sites;
//use App\Model\Zones;
class Statistics class Statistics
{ {
...@@ -13,15 +11,11 @@ class Statistics ...@@ -13,15 +11,11 @@ class Statistics
public function __construct(/*Sites $sites, Zones $zones, $countries*/) public function __construct(/*Sites $sites, Zones $zones, $countries*/)
{ {
$this->hashSolt = 'FsRpCKc021PzwqOR8o1mXLe8AIS6YmnfkDvECBY6MzGWHhceS4EvdOnW7dYHt7AA'; $this->hashSolt = 'FsRpCKc021PzwqOR8o1mXLe8AIS6YmnfkDvECBY6MzGWHhceS4EvdOnW7dYHt7AA';
//$this->sitesModel = $sites;
//$this->zonesModel = $zones;
//$this->countryCodes = $countries;
} }
// Данные по отчетам фидов // Данные по отчетам фидов
public function getStatData($report_type, $feed_id_list, $dates) public function getFeedStatData($report_type, $feed_id_list, $dates)
{ {
$timeDiff = (strtotime($dates[1])-strtotime($dates[0]))/(24*60*60); $timeDiff = (strtotime($dates[1])-strtotime($dates[0]))/(24*60*60);
// Определяем разрешение выборки (группировку) по времени: // Определяем разрешение выборки (группировку) по времени:
...@@ -34,8 +28,18 @@ class Statistics ...@@ -34,8 +28,18 @@ class Statistics
$dates_group = "Day"; $dates_group = "Day";
} }
// Параметры запроса по типу отчета:
switch ($report_type) {
case 'common':
$type = 'feed_stat'; $type = 'feed_stat';
$fields = ['Views','Clicks','Orders','OrderSum']; $fields = ['Views','Clicks','Orders','OrderSum'];
break;
case 'transaction':
$type = 'feed_stat';
$fields = ['Views','Clicks','Orders','OrderSum'];
break;
}
$dates = array( $dates = array(
'group' => $dates_group, 'group' => $dates_group,
'start' => $dates[0], 'start' => $dates[0],
...@@ -55,7 +59,6 @@ class Statistics ...@@ -55,7 +59,6 @@ class Statistics
) )
); );
//return $dataRequest; //return $dataRequest;
$stats = $this->apiRequest($dataRequest); $stats = $this->apiRequest($dataRequest);
//return $stats; //return $stats;
...@@ -78,8 +81,7 @@ class Statistics ...@@ -78,8 +81,7 @@ class Statistics
foreach ($data as $cat=>$value) { foreach ($data as $cat=>$value) {
$data_stats[$cat][] = $value/$min_koef; $data_stats[$cat][] = $value/$min_koef;
} }
// Временно: $data_stats['AdMoney'][] = 224 * $data['Orders']; // временно
$data_stats['AdMoney'][] = 224 * $data['Orders'];
} }
// Формируем пустые данные для временного промежутка // Формируем пустые данные для временного промежутка
...@@ -88,11 +90,9 @@ class Statistics ...@@ -88,11 +90,9 @@ class Statistics
foreach ($cats as $cat) { foreach ($cats as $cat) {
$data_stats[$cat][] = 0; $data_stats[$cat][] = 0;
} }
// Временно: $data_stats['AdMoney'][] = 0; // временно
$data_stats['AdMoney'][] = 0;
} }
// Логика формирования данных по временному интервалу: // Логика формирования данных по временному интервалу:
if (false) { if (false) {
if ($timeDiff == 0) // Одни сутки if ($timeDiff == 0) // Одни сутки
......
...@@ -106,7 +106,7 @@ $system_link = $this->url('adm.system.actions'); ...@@ -106,7 +106,7 @@ $system_link = $this->url('adm.system.actions');
--> -->
<div class="b-feeds-stat_controls form-group"> <div class="b-feeds-stat_controls form-group">
<?php /* ?> <?php /* Переключатель отчетов */ ?>
<div class="b-feeds-stat_controls-report"> <div class="b-feeds-stat_controls-report">
<div class="dropdown" style="display:inline-block;"> <div class="dropdown" style="display:inline-block;">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
...@@ -123,10 +123,9 @@ $system_link = $this->url('adm.system.actions'); ...@@ -123,10 +123,9 @@ $system_link = $this->url('adm.system.actions');
</ul> </ul>
</div> </div>
</div> </div>
<?php */ ?>
<?php /* Выбор дат */ ?>
<span class="b-feeds-stat_controls-period"> <span class="b-feeds-stat_controls-period">
<div style="display:inline-block;">Дата: </div> <div style="display:inline-block;">Дата: </div>
<input type='text' id="date-value-1" class="btn btn-default date-value" value="<?=$dates[0] ?>"/> &ndash; <input type='text' id="date-value-1" class="btn btn-default date-value" value="<?=$dates[0] ?>"/> &ndash;
<input type='text' id="date-value-2" class="btn btn-default date-value" value="<?=$dates[1] ?>"/> <input type='text' id="date-value-2" class="btn btn-default date-value" value="<?=$dates[1] ?>"/>
...@@ -154,8 +153,6 @@ $system_link = $this->url('adm.system.actions'); ...@@ -154,8 +153,6 @@ $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> <div id="chart-graph-stat" style="height: 370px;" data-colors=<?= ($colors_active_lines ? json_encode($colors_active_lines) : '')?>></div>
<?php endif ?> <?php endif ?>
<?php // print_r($periodStats); ?>
<?php /* Таблица */ ?> <?php /* Таблица */ ?>
<div id="table-stat" class="b-table_wrapp"> <div id="table-stat" class="b-table_wrapp">
<div class="b-content__loading"></div> <div class="b-content__loading"></div>
......
...@@ -58,7 +58,7 @@ $lang = $layoutInfo ? $layoutInfo->getLang() : 'en'; ...@@ -58,7 +58,7 @@ $lang = $layoutInfo ? $layoutInfo->getLang() : 'en';
<body> <body>
<?php <?php
//$urlHome = $this->url(in_array($identityRole, [\App\Acl\Roles::ROLE_ADMIN,\App\Acl\Roles::ROLE_MANAGER]) ?'adm.index' :'home',['lang' => $lang]); //$urlHome = $this->url(in_array($identityRole, [\App\Acl\Roles::ROLE_ADMIN,\App\Acl\Roles::ROLE_MANAGER]) ?'adm.index' :'home',['lang' => $lang]);
$urlHome = $this->url('user.cabinet',['lang' => $lang]); $urlHome = $this->url('home',['lang' => $lang]);
?> ?>
......
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