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
66fc9497
Commit
66fc9497
authored
Jan 24, 2019
by
Александр Чаплыгин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавил в конфиг названия отчетов, проброс списка отчетов в шаблон
parent
29af8eab
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
11 deletions
+23
-11
feeds.global.php
src/config/autoload/feeds.global.php
+2
-0
Cabinet.php
src/src/App/Action/User/Cabinet.php
+12
-2
cabinet-feed.phtml
src/templates/app/user/cabinet-feed.phtml
+9
-9
No files found.
src/config/autoload/feeds.global.php
View file @
66fc9497
...
@@ -28,6 +28,7 @@ return [
...
@@ -28,6 +28,7 @@ return [
],
],
'reports'
=>
[
'reports'
=>
[
'common'
=>
[
'common'
=>
[
'title'
=>
'Сводный отчет'
,
'cats'
=>
[
'cats'
=>
[
'Views'
=>
'Показы'
,
'Views'
=>
'Показы'
,
'Clicks'
=>
'Клики'
,
'Clicks'
=>
'Клики'
,
...
@@ -37,6 +38,7 @@ return [
...
@@ -37,6 +38,7 @@ return [
]
]
],
],
'transaction'
=>
[
'transaction'
=>
[
'title'
=>
'Транзакции'
,
'cats'
=>
[
'cats'
=>
[
'Views'
=>
'Показы'
,
'Views'
=>
'Показы'
,
'Clicks'
=>
'Клики'
,
'Clicks'
=>
'Клики'
,
...
...
src/src/App/Action/User/Cabinet.php
View file @
66fc9497
...
@@ -106,7 +106,15 @@ class Cabinet extends Common
...
@@ -106,7 +106,15 @@ class Cabinet extends Common
$current_period
=
'current_month'
;
$current_period
=
'current_month'
;
$dates
=
[
date
(
'Y-m-01'
),
date
(
'Y-m-d'
)];
$dates
=
[
date
(
'Y-m-01'
),
date
(
'Y-m-d'
)];
$report_conf
=
$this
->
container
->
get
(
'config'
)[
'feed_conf'
][
'reports'
][
$report_type
];
$reports_conf
=
$this
->
container
->
get
(
'config'
)[
'feed_conf'
][
'reports'
];
$report_conf
=
$reports_conf
[
$report_type
];
// Список отчетов:
$reports_list
=
[];
foreach
(
$reports_conf
as
$report_name
=>
$report_value
)
{
$reports_list
[
$report_name
]
=
$report_value
[
'title'
];
}
switch
(
$report_type
)
{
switch
(
$report_type
)
{
case
'common'
:
case
'common'
:
...
@@ -127,7 +135,9 @@ class Cabinet extends Common
...
@@ -127,7 +135,9 @@ class Cabinet extends Common
$data
[
'dates'
]
=
$dates
;
$data
[
'dates'
]
=
$dates
;
$data
[
'periodStats'
]
=
$periodStats
;
$data
[
'periodStats'
]
=
$periodStats
;
//$data['campaignStats'] = $campaignStats;
//$data['campaignStats'] = $campaignStats;
$data
[
'cats'
]
=
$cats
=
$this
->
container
->
get
(
'config'
)[
'feed_conf'
][
'reports'
][
$report_type
][
'cats'
];
$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
[
'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/templates/app/user/cabinet-feed.phtml
View file @
66fc9497
...
@@ -61,8 +61,11 @@ if (!$error) {
...
@@ -61,8 +61,11 @@ if (!$error) {
//$campaignStats = $this->campaignStats;
//$campaignStats = $this->campaignStats;
$current_period
=
$this
->
current_period
;
$current_period
=
$this
->
current_period
;
$dates
=
$this
->
dates
;
$dates
=
$this
->
dates
;
$cats
=
$this
->
cats
;
$report
=
$this
->
report
;
$report
=
$this
->
report
;
$report_conf
=
$this
->
report_conf
;
$report_title
=
$report_conf
[
'title'
];
$report_cats
=
$report_conf
[
'cats'
];
$reports_list
=
$this
->
reports_list
;
$periods_list
=
$this
->
periods_list
;
$periods_list
=
$this
->
periods_list
;
$colors_active_lines
=
$this
->
colors_active_lines
;
$colors_active_lines
=
$this
->
colors_active_lines
;
...
@@ -117,16 +120,13 @@ if (!$error) {
...
@@ -117,16 +120,13 @@ if (!$error) {
<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"
>
<?php
if
(
$report
==
'common'
)
:
?>
<?=
_t
(
$report_title
)
?>
<?=
_t
(
'Сводный отчет'
)
?>
<?php
else
:
?>
<?=
_t
(
'Транзакции'
)
?>
<?php
endif
;
?>
<span
class=
"caret"
></span>
<span
class=
"caret"
></span>
</button>
</button>
<ul
class=
"dropdown-menu"
aria-labelledby=
"dropdownMenu"
>
<ul
class=
"dropdown-menu"
aria-labelledby=
"dropdownMenu"
>
<li><a
href=
"
<?=
$this
->
url
(
'user.cabinet'
,
[
'lang'
=>
$this
->
lang
,
'report'
=>
'common'
])
?>
"
<?php
if
(
$report
==
'common'
)
:
?>
class=
"current"
<?php
endif
;
?>
report=
"common"
>
<?=
_t
(
'Сводный отчет'
)
?>
</a></li>
<?php
foreach
(
$reports_list
as
$report_name
=>
$report_title
)
:
?>
<li><a
href=
"
<?=
$this
->
url
(
'user.cabinet'
,
[
'lang'
=>
$this
->
lang
,
'report'
=>
'transaction'
])
?>
"
<?php
if
(
$report
==
'transaction'
)
:
?>
class=
"current"
<?php
endif
;
?>
report=
"transaction"
>
<?=
_t
(
'Транзакции'
)
?>
</a></li>
<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>
<?php
endforeach
;
?>
</ul>
</ul>
</div>
</div>
</div>
</div>
...
@@ -175,7 +175,7 @@ if (!$error) {
...
@@ -175,7 +175,7 @@ if (!$error) {
<b
class=
"main-cat date selected"
>
<?=
_t
(
'Транзакция'
)
?>
</b>
<b
class=
"main-cat date selected"
>
<?=
_t
(
'Транзакция'
)
?>
</b>
<?php
endif
;
?>
<?php
endif
;
?>
</th>
</th>
<?php
foreach
(
$cats
as
$name
=>
$title
)
:
?>
<?php
foreach
(
$
report_
cats
as
$name
=>
$title
)
:
?>
<th>
<th>
<?php
if
(
$report
==
'common'
)
:
?>
<?php
if
(
$report
==
'common'
)
:
?>
<span
style=
"border-color:
<?=
$colors_active_lines
[
$name
]
?>
;"
>
<span
style=
"border-color:
<?=
$colors_active_lines
[
$name
]
?>
;"
>
...
...
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