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
83c7d45a
Commit
83c7d45a
authored
May 30, 2019
by
Александр Чаплыгин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Отключил обработку post-запросов в контроллере для истоии по клику и заказу
parent
407dc8bb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
73 deletions
+4
-73
ViewId.php
src/src/App/Action/User/ViewId.php
+4
-70
Statistics.php
src/src/App/Model/Statistics.php
+0
-3
No files found.
src/src/App/Action/User/ViewId.php
View file @
83c7d45a
...
@@ -80,12 +80,10 @@ class ViewId extends Common
...
@@ -80,12 +80,10 @@ class ViewId extends Common
if
(
$request
->
getMethod
()
==
'POST'
)
{
if
(
$request
->
getMethod
()
==
'POST'
)
{
try
{
try
{
switch
(
$request
->
getAttribute
(
'action'
))
{
$data
=
[
case
self
::
ACTION_STAT
:
'result'
=>
false
,
$response
=
$this
->
getStatData
(
$request
);
];
break
;
$response
=
new
JsonResponse
(
$data
);
default
:
}
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
$data
=
[
$data
=
[
'result'
=>
false
,
'result'
=>
false
,
...
@@ -183,67 +181,4 @@ class ViewId extends Common
...
@@ -183,67 +181,4 @@ class ViewId extends Common
}
}
}
}
private
function
getStatData
(
ServerRequestInterface
$request
)
{
/** @var UserService $auth */
$auth
=
$this
->
container
->
get
(
UserService
::
class
);
$userId
=
$auth
->
getIdentity
()
->
getId
();
/** @var \App\Model\Statistics $stats */
$stats
=
$this
->
container
->
get
(
Statistics
::
class
);
// Выводим стр. по фидам, если за пользователем закреплен фид:
/** @var \App\Model\Feeds $feedsModel */
$feedsModel
=
$this
->
container
->
get
(
Feeds
::
class
);
$feeds
=
$feedsModel
->
findAll
([
'clientid'
=>
$userId
])
->
toArray
();
// Фиды пользователя:
$feed_id_list
=
[];
foreach
(
$feeds
as
$feed_item
)
{
$feed_id
=
$feed_item
[
'id'
];
if
(
!
in_array
(
$feed_id
,
$feed_id_list
))
{
$feed_id_list
[]
=
$feed_id
;
}
}
$report_type
=
$request
->
getAttribute
(
'report'
);
$data_request
=
$request
->
getParsedBody
();
$dates
=
$data_request
[
'period'
];
$report_conf
=
$this
->
container
->
get
(
'config'
)[
'feed_conf'
][
'reports'
][
$report_type
];
switch
(
$report_type
)
{
case
'common'
:
$periodStats
=
$stats
->
getFeedStatData
(
$report_type
,
$feed_id_list
,
$dates
,
$report_conf
);
//$campaignStats = $statsDaysModel->getStatsByFeeds($feed_id_list, $dates);
break
;
case
'transactions'
:
$periodStats
=
$stats
->
getFeedStatData
(
$report_type
,
$feed_id_list
,
$dates
,
$report_conf
);
break
;
default
:
$periodStats
=
null
;
$campaignStats
=
null
;
break
;
}
if
(
!
$periodStats
)
{
return
new
JsonResponse
(
null
);
}
/*
if ($periodStats || $companyStats) {
$data = array(
'period' => $periodStats,
'campaign' => $campaignStats,
);
} else {
$data = null;
}
*/
$data
=
$periodStats
;
return
new
JsonResponse
(
$data
);
}
}
}
\ No newline at end of file
src/src/App/Model/Statistics.php
View file @
83c7d45a
...
@@ -287,9 +287,6 @@ class Statistics
...
@@ -287,9 +287,6 @@ class Statistics
'data'
=>
array
(
'data'
=>
array
(
'feed_id'
=>
(
int
)
$feed_id
,
'feed_id'
=>
(
int
)
$feed_id
,
'view_id'
=>
$view_id
'view_id'
=>
$view_id
//'feed_id' => 10004,
//'view_id' => '94ed3f578fa785d3'
)
)
);
);
...
...
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