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
df12cd85
Commit
df12cd85
authored
Jan 30, 2019
by
Александр Чаплыгин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавил строку итого в табл. common, transactions-очтетов, правка для пустых данных графика
parent
8ddde43e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
33 deletions
+76
-33
styles-feeds-stat.css
src/public/css/styles-feeds-stat.css
+11
-3
script-feeds-stat-table.js
src/public/js/script-feeds-stat-table.js
+63
-29
Statistics.php
src/src/App/Model/Statistics.php
+2
-1
No files found.
src/public/css/styles-feeds-stat.css
View file @
df12cd85
...
@@ -215,7 +215,7 @@ input[type="checkbox"]
...
@@ -215,7 +215,7 @@ input[type="checkbox"]
/* .b-basket-content */
/* .b-basket-content */
.table.table-striped.admin.transaction
thead
tr
th
.period
.table.table-striped.admin.transaction
thead
tr
th
.period
{
{
width
:
10
0px
;
min-width
:
11
0px
;
}
}
.table.table-striped.admin
thead
tr
th
.Timestamp
.table.table-striped.admin
thead
tr
th
.Timestamp
...
@@ -244,7 +244,7 @@ input[type="checkbox"]
...
@@ -244,7 +244,7 @@ input[type="checkbox"]
.table.table-striped.admin
thead
tr
th
.Basket
.basket-link
.table.table-striped.admin
thead
tr
th
.Basket
.basket-link
{
{
width
:
5
2
0px
;
width
:
5
3
0px
;
}
}
.table.table-striped.admin
thead
tr
th
.Basket
.quantity
.table.table-striped.admin
thead
tr
th
.Basket
.quantity
...
@@ -268,6 +268,14 @@ input[type="checkbox"]
...
@@ -268,6 +268,14 @@ input[type="checkbox"]
font-weight
:
bold
;
font-weight
:
bold
;
text-align
:
right
;
text-align
:
right
;
}
}
.table.table-striped.admin.transaction
tbody
tr
.total-orders
{
font-weight
:
bold
;
font-size
:
13px
;
}
.b-basket-content
.b-basket-content
{
{
...
@@ -287,7 +295,7 @@ input[type="checkbox"]
...
@@ -287,7 +295,7 @@ input[type="checkbox"]
.b-basket-content
.quantity
.b-basket-content
.quantity
{
{
display
:
inline-block
;
display
:
inline-block
;
width
:
5
0
px
;
width
:
5
5
px
;
}
}
.b-basket-content
.price
.b-basket-content
.price
...
...
src/public/js/script-feeds-stat-table.js
View file @
df12cd85
...
@@ -58,33 +58,15 @@ $(document).ready(function(){
...
@@ -58,33 +58,15 @@ $(document).ready(function(){
function
RenderInterval
(
dataLineChartStat
)
function
RenderInterval
(
dataLineChartStat
)
{
{
var
dataPeriod
=
dataLineChartStat
[
'period'
];
var
dataPeriod
=
dataLineChartStat
[
'period'
];
dataTable
=
dataLineChartStat
;
// Добавляем строку "Итого":
if
(
!
dataLineChartStat
.
report
==
'transaction'
)
{
$row
=
$
(
'<tr style="font-weight: bold;">'
);
//dataTable = dataLineChartStat;
$row
.
append
(
$
(
'<td>'
).
html
(
"Итого"
));
dataTable
=
{};
activeLines
.
forEach
(
function
(
item
){
for
(
var
key
in
dataLineChartStat
)
{
currentActiveLine
=
item
;
dataTable
[
key
]
=
dataLineChartStat
[
key
];
var
isNotSumValue
=
notFormatFields
.
indexOf
(
currentActiveLine
)
>
-
1
;
if
(
!
isNotSumValue
)
{
var
totalValue
=
0
;
for
(
var
i
=
dataPeriod
.
length
-
1
;
i
>=
0
;
i
--
)
{
totalValue
+=
dataTable
[
item
][
i
];
}
}
else
{
totalValue
=
''
;
}
$row
.
append
(
$
(
'<td>'
).
html
(
valueFormat
(
totalValue
)));
});
$row
.
appendTo
(
$tableContent
);
}
}
console
.
log
(
'AAA dataTable = '
,
dataLineChartStat
.
report
);
// Сортировка строк в таблице:
// Сортировка строк в таблице:
var
var
...
@@ -100,7 +82,7 @@ $(document).ready(function(){
...
@@ -100,7 +82,7 @@ $(document).ready(function(){
if
(
sortField
)
{
if
(
sortField
)
{
//console.log('AAA sortField = ', sortField, ' isDesc = ', isDesc);
//console.log('AAA sortField = ', sortField, ' isDesc = ', isDesc);
//console.log('AAA dataTable = ', dataTable);
var
dataTableForSort
=
[];
var
dataTableForSort
=
[];
...
@@ -140,10 +122,12 @@ $(document).ready(function(){
...
@@ -140,10 +122,12 @@ $(document).ready(function(){
activeLines
.
forEach
(
function
(
line
){
activeLines
.
forEach
(
function
(
line
){
if
(
line
==
'Basket'
)
{
if
(
line
==
'Basket'
)
{
var
dataBasket
=
item
[
line
];
var
dataBasket
=
item
[
line
];
currentActiveLine
=
'Price'
;
//currentActiveLine = 'Price';
currentActiveLine
=
line
;
dataBasket
.
forEach
(
function
(
dataBasketItem
,
ind
){
dataBasket
.
forEach
(
function
(
dataBasketItem
,
ind
){
dataBasket
[
ind
][
'Price'
]
=
valueFormat
(
dataBasketItem
[
'Price'
]);
dataBasket
[
ind
][
'Price'
]
=
valueFormat
(
dataBasketItem
[
'Price'
]);
});
});
//console.log('AAA dataBasket = ', dataBasket);
$row
.
append
(
$
(
'<td class="'
+
line
+
'">'
).
append
(
templateBasketContent
({
data
:
dataBasket
})));
$row
.
append
(
$
(
'<td class="'
+
line
+
'">'
).
append
(
templateBasketContent
({
data
:
dataBasket
})));
}
else
if
(
line
==
'Timestamp'
)
{
}
else
if
(
line
==
'Timestamp'
)
{
var
var
...
@@ -186,7 +170,6 @@ $(document).ready(function(){
...
@@ -186,7 +170,6 @@ $(document).ready(function(){
dataBasket
.
forEach
(
function
(
dataBasketItem
,
ind
){
dataBasket
.
forEach
(
function
(
dataBasketItem
,
ind
){
dataBasket
[
ind
][
'Price'
]
=
valueFormat
(
dataBasketItem
[
'Price'
]);
dataBasket
[
ind
][
'Price'
]
=
valueFormat
(
dataBasketItem
[
'Price'
]);
});
});
console
.
log
(
'AAA dataBasket = '
,
dataBasket
);
$row
.
append
(
$
(
'<td class="'
+
item
+
'">'
).
append
(
templateBasketContent
({
data
:
dataBasket
})));
$row
.
append
(
$
(
'<td class="'
+
item
+
'">'
).
append
(
templateBasketContent
({
data
:
dataBasket
})));
}
else
if
(
item
==
'Timestamp'
)
{
}
else
if
(
item
==
'Timestamp'
)
{
var
var
...
@@ -206,6 +189,57 @@ $(document).ready(function(){
...
@@ -206,6 +189,57 @@ $(document).ready(function(){
}
}
}
}
// Добавляем строку "Итого":
if
(
dataLineChartStat
.
report
!=
'transaction'
)
{
$row
=
$
(
'<tr style="font-weight: bold;">'
);
$row
.
append
(
$
(
'<td>'
).
html
(
"Итого"
));
activeLines
.
forEach
(
function
(
item
){
currentActiveLine
=
item
;
var
isNotSumValue
=
notFormatFields
.
indexOf
(
currentActiveLine
)
>
-
1
;
if
(
!
isNotSumValue
)
{
var
totalValue
=
0
;
for
(
var
i
=
dataPeriod
.
length
-
1
;
i
>=
0
;
i
--
)
{
totalValue
+=
dataTable
[
item
][
i
];
}
}
else
{
totalValue
=
''
;
}
$row
.
append
(
$
(
'<td>'
).
html
(
valueFormat
(
totalValue
)));
});
$row
.
appendTo
(
$tableContent
);
}
// Добавляем строку "Всего заказов":
if
(
dataLineChartStat
.
report
==
'transaction'
)
{
$row
=
$
(
'<tr class="total-orders" style="">'
);
$row
.
append
(
$
(
'<td>'
).
html
(
"Всего заказов: "
+
dataPeriod
.
length
));
activeLines
.
forEach
(
function
(
item
){
currentActiveLine
=
item
;
var
isNotSumValue
=
notFormatFields
.
indexOf
(
currentActiveLine
)
>
-
1
;
if
(
!
isNotSumValue
)
{
var
totalValue
=
0
;
for
(
var
i
=
dataPeriod
.
length
-
1
;
i
>=
0
;
i
--
)
{
totalValue
+=
dataTable
[
item
][
i
];
}
}
else
{
totalValue
=
''
;
}
$row
.
append
(
$
(
'<td class="'
+
item
+
'">'
).
html
(
valueFormat
(
totalValue
)));
});
$row
.
appendTo
(
$tableContent
);
}
}
}
$
.
extend
({
$
.
extend
({
...
@@ -218,7 +252,7 @@ $(document).ready(function(){
...
@@ -218,7 +252,7 @@ $(document).ready(function(){
activeLines
.
push
(
$
(
this
).
attr
(
'id'
));
activeLines
.
push
(
$
(
this
).
attr
(
'id'
));
});
});
//
console.log('AAA TableStat render: ', dataLineChartStat);
console
.
log
(
'AAA TableStat render: '
,
dataLineChartStat
);
//console.log('AAA activeLines: ', activeLines);
//console.log('AAA activeLines: ', activeLines);
dataTable
=
{};
dataTable
=
{};
...
...
src/src/App/Model/Statistics.php
View file @
df12cd85
...
@@ -208,7 +208,8 @@ class Statistics
...
@@ -208,7 +208,8 @@ class Statistics
$stat_from
=
new
DateTime
(
$stat_days
[
0
]);
$stat_from
=
new
DateTime
(
$stat_days
[
0
]);
$stat_to
=
new
DateTime
(
$stat_days
[
count
(
$stat_days
)
-
1
]);
$stat_to
=
new
DateTime
(
$stat_days
[
count
(
$stat_days
)
-
1
]);
if
((
$item
>=
$stat_from
)
&&
(
$item
<=
$stat_to
))
{
//if (($item>= $stat_from) && ($item<= $stat_to)) {
if
((
$item
>=
$stat_from
))
{
$period
[]
=
$day_item
;
$period
[]
=
$day_item
;
if
(
$stats
[
'data'
][
'Day'
][
$day_item
])
{
if
(
$stats
[
'data'
][
'Day'
][
$day_item
])
{
AddDataStats
(
$dataStats
,
$stats
[
'data'
][
'Day'
][
$day_item
],
$dataStats
[
'type'
]);
AddDataStats
(
$dataStats
,
$stats
[
'data'
][
'Day'
][
$day_item
],
$dataStats
[
'type'
]);
...
...
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