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
56c60383
Commit
56c60383
authored
Mar 25, 2020
by
Александр Чаплыгин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Определение временного интервала для общей статистики, правки для таблицы
parent
7ad74898
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
13 deletions
+31
-13
styles-amsystem.css
src/public/css/styles-amsystem.css
+1
-5
amsystem-campaign.js
src/public/js/adm/amsystem-campaign.js
+2
-2
CabinetAmSystem.php
src/src/App/Action/User/CabinetAmSystem.php
+3
-2
Statistics.php
src/src/App/Model/Statistics.php
+25
-4
No files found.
src/public/css/styles-amsystem.css
View file @
56c60383
...
...
@@ -391,12 +391,8 @@ textarea#cities-codes
.table.table-by-cats
tr
.cat
{
background-color
:
#f9f9f9
;
font-weight
:
bold
;
}
.table.table-by-cats
tr
.cat
td
.period
{
font-weight
:
bold
;
}
.table.table-by-cats
span
.group
b
.open
{
...
...
src/public/js/adm/amsystem-campaign.js
View file @
56c60383
...
...
@@ -241,7 +241,7 @@ $(document).ready(function () {
codeCities
=
JSON
.
parse
(
$
(
'#cities-codes'
).
val
());
}
//console.log('AAA dataStat = ', dataSites
Stat);
console
.
log
(
'AAA dataStat = '
,
data
Stat
);
function
ShowCommonStatInfo
()
{
...
...
@@ -537,7 +537,7 @@ $(document).ready(function () {
if
(
item
[
'sub'
])
{
for
(
var
zone
in
item
[
'sub'
])
{
$row
=
$
(
'<tr class="subcat" data-parent="'
+
item
[
'site'
]
+
'">'
);
$row
.
append
(
$
(
'<td class="subcat-title">'
).
html
(
'
зона [
'
+
zone
%
100
+
'] ('
+
item
[
'sub'
][
zone
][
'size'
]
+
')'
));
$row
.
append
(
$
(
'<td class="subcat-title">'
).
html
(
'
[зона
'
+
zone
%
100
+
'] ('
+
item
[
'sub'
][
zone
][
'size'
]
+
')'
));
activeLinesId
.
forEach
(
function
(
line
){
$row
.
append
(
$
(
'<td class="stat '
+
line
+
'">'
).
html
(
valueFormatTable
(
item
[
'sub'
][
zone
][
line
],
line
)));
});
...
...
src/src/App/Action/User/CabinetAmSystem.php
View file @
56c60383
...
...
@@ -155,10 +155,11 @@ class CabinetAmSystem extends Common
/** @var \App\Model\Statistics $stats */
$stats
=
$this
->
container
->
get
(
\App\Model\Statistics
::
class
);
$date_begin
=
$campaign
->
getDateBegin
();
$date_end_common
=
$campaign
->
getDateEnd
()
?
:
null
;
$date_end
=
$campaign
->
getDateEnd
()
?
:
date
(
"Y-m-d"
);
// последние 90 дней, если кампания долго идет
$dates_common
=
[
$date_begin
,
$date_end_common
];
$dates
=
[
$date_begin
,
$date_end
];
$campaign_stat
=
$stats
->
getCampaignsStat
([(
int
)
$campaign_id
],
$campaign
->
getTargetAction
(),
$dates
);
$campaign_stat
=
$stats
->
getCampaignsStat
([(
int
)
$campaign_id
],
$campaign
->
getTargetAction
(),
$dates
_common
);
$campaign_stat_total
=
$stats
->
getCampaignsStat
([(
int
)
$campaign_id
],
$campaign
->
getTargetAction
(),
null
);
$active_line
=
'views'
;
...
...
src/src/App/Model/Statistics.php
View file @
56c60383
...
...
@@ -356,8 +356,20 @@ class Statistics
);
if
(
$dates
)
{
// последние 90 дней, если кампания долго идет
$dataRequest
[
'data'
][
'start_date'
]
=
$dates
[
0
];
$dataRequest
[
'data'
][
'end_date'
]
=
$dates
[
1
];
if
(
$dates
[
1
]
&&
$dates
[
1
]
<
date
(
"Y-m-d"
))
{
$date_end
=
$dates
[
1
];
}
else
{
$date_end
=
date
(
"Y-m-d"
);
}
$dataRequest
[
'data'
][
'end_date'
]
=
$date_end
;
//$date_start = $dates[0];
//$interval = date($date_end)->diff(date($date_start)); // получаем разницу в виде объекта DateInterval
//$dataRequest['data']['diff'] = $interval->d;
$dataRequest
[
'data'
][
'by_days'
]
=
true
;
}
...
...
@@ -444,15 +456,24 @@ class Statistics
$stat_from
=
new
DateTime
(
$stat_days
[
0
]);
$stat_to
=
new
DateTime
(
$stat_days
[
count
(
$stat_days
)
-
1
]);
//if (($item >= $stat_from) && ($item <= $stat_to)) {
//if (($item >= $stat_from)) {
if
((
$item
<=
$stat_to
))
{
if
(
$dates
[
1
]
&&
$dates
[
1
]
<
date
(
"Y-m-d"
))
{
$period
[]
=
$day_item
;
if
(
$stats
[
$day_item
])
{
AddDataStats
(
$dataStats
,
$stats
[
$day_item
]);
}
else
{
AddDataStatsNull
(
$dataStats
,
$stat_cats
);
}
}
else
{
//if (($item >= $stat_from) && ($item <= $stat_to)) {
//if (($item >= $stat_from)) {
if
((
$item
<=
$stat_to
))
{
$period
[]
=
$day_item
;
if
(
$stats
[
$day_item
])
{
AddDataStats
(
$dataStats
,
$stats
[
$day_item
]);
}
else
{
AddDataStatsNull
(
$dataStats
,
$stat_cats
);
}
}
}
}
...
...
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