Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
addcpm-json
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Александр Чаплыгин
addcpm-json
Commits
f1e25e72
Commit
f1e25e72
authored
Jan 16, 2019
by
Александр Чаплыгин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добвил контроллер для статистики Statisctics
parent
a1df3c52
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
6 deletions
+15
-6
dependencies.global.php
src/config/autoload/dependencies.global.php
+3
-3
Statistics.php
src/src/App/Action/Statistics.php
+0
-0
Cabinet.php
src/src/App/Action/User/Cabinet.php
+9
-2
Statistics.php
src/src/App/Model/Statistics.php
+0
-0
cabinet-feed.phtml
src/templates/app/user/cabinet-feed.phtml
+3
-1
No files found.
src/config/autoload/dependencies.global.php
View file @
f1e25e72
...
@@ -263,9 +263,9 @@ return [
...
@@ -263,9 +263,9 @@ return [
},
},
\App\Model\Statistics
::
class
=>
function
(
ContainerInterface
$container
)
{
\App\Model\Statistics
::
class
=>
function
(
ContainerInterface
$container
)
{
return
new
\App\Model\Statistics
(
return
new
\App\Model\Statistics
(
$container
->
get
(
\App\Model\Sites
::
class
),
//
$container->get(\App\Model\Sites::class),
$container
->
get
(
\App\Model\Zones
::
class
),
//
$container->get(\App\Model\Zones::class),
$container
->
get
(
'config'
)[
'country_codes'
]
//
$container->get('config')['country_codes']
);
);
},
},
],
],
...
...
src/src/App/Action/Statistics.php
0 → 100644
View file @
f1e25e72
This diff is collapsed.
Click to expand it.
src/src/App/Action/User/Cabinet.php
View file @
f1e25e72
...
@@ -58,6 +58,9 @@ class Cabinet extends Common
...
@@ -58,6 +58,9 @@ class Cabinet extends Common
function
__invoke
(
ServerRequestInterface
$request
,
ResponseInterface
$response
,
callable
$next
=
null
)
function
__invoke
(
ServerRequestInterface
$request
,
ResponseInterface
$response
,
callable
$next
=
null
)
{
{
/** @var \App\Model\Statistics $stats */
$stats
=
$this
->
container
->
get
(
Statistics
::
class
);
if
(
$request
->
getMethod
()
==
'POST'
)
{
if
(
$request
->
getMethod
()
==
'POST'
)
{
try
{
try
{
...
@@ -109,7 +112,8 @@ class Cabinet extends Common
...
@@ -109,7 +112,8 @@ class Cabinet extends Common
$statsDaysModel
=
$this
->
container
->
get
(
StatsDays
::
class
);
$statsDaysModel
=
$this
->
container
->
get
(
StatsDays
::
class
);
//$stats = $statsDaysModel->findAll(['FeedID' => $feed_id_list])->toArray();
//$stats = $statsDaysModel->findAll(['FeedID' => $feed_id_list])->toArray();
$periodStats
=
$statsDaysModel
->
getStatsByDate
(
$feed_id_list
,
$dates
);
$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
=
[
$cats
=
[
'shows'
=>
'Показы'
,
'shows'
=>
'Показы'
,
...
@@ -119,6 +123,7 @@ class Cabinet extends Common
...
@@ -119,6 +123,7 @@ class Cabinet extends Common
'admoney'
=>
'admoney'
'admoney'
=>
'admoney'
];
];
/*
if ($campaignStats || count($campaignStats['period'])>0) {
if ($campaignStats || count($campaignStats['period'])>0) {
$feeds_names = [];
$feeds_names = [];
foreach($campaignStats['period'] as $feed_id) {
foreach($campaignStats['period'] as $feed_id) {
...
@@ -127,6 +132,7 @@ class Cabinet extends Common
...
@@ -127,6 +132,7 @@ class Cabinet extends Common
}
}
$campaignStats['period'] = $feeds_names;
$campaignStats['period'] = $feeds_names;
}
}
*/
break
;
break
;
case
'transaction'
:
case
'transaction'
:
...
@@ -165,8 +171,9 @@ class Cabinet extends Common
...
@@ -165,8 +171,9 @@ class Cabinet extends Common
$data
[
'report'
]
=
$report_type
;
$data
[
'report'
]
=
$report_type
;
$data
[
'current_period'
]
=
$current_period
;
$data
[
'current_period'
]
=
$current_period
;
$data
[
'dates'
]
=
$dates
;
$data
[
'dates'
]
=
$dates
;
$data
[
'stat'
]
=
$stat
;
$data
[
'periodStats'
]
=
$periodStats
;
$data
[
'periodStats'
]
=
$periodStats
;
$data
[
'campaignStats'
]
=
$campaignStats
;
//
$data['campaignStats'] = $campaignStats;
$data
[
'cats'
]
=
$cats
;
$data
[
'cats'
]
=
$cats
;
$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'
];
...
...
src/src/App/Model/Statistics.php
View file @
f1e25e72
This diff is collapsed.
Click to expand it.
src/templates/app/user/cabinet-feed.phtml
View file @
f1e25e72
...
@@ -152,6 +152,8 @@ $system_link = $this->url('adm.system.actions');
...
@@ -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
>
<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
(
$stat
);
?>
<?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>
...
@@ -160,7 +162,7 @@ $system_link = $this->url('adm.system.actions');
...
@@ -160,7 +162,7 @@ $system_link = $this->url('adm.system.actions');
<tr>
<tr>
<th>
<th>
<?php
if
(
$report
==
'common'
)
:
?>
<?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
:
?>
<?php
else
:
?>
<b
class=
"main-cat date selected"
>
<?=
_t
(
'Транзакция'
)
?>
</b>
<b
class=
"main-cat date selected"
>
<?=
_t
(
'Транзакция'
)
?>
</b>
<?php
endif
;
?>
<?php
endif
;
?>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment