Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2018-07-17 23:34:35 +0300
committerGitHub <noreply@github.com>2018-07-17 23:34:35 +0300
commit74334d8d0908910ed3cc4a9a918436d9f9ccc3f6 (patch)
treebada789873ec90c243f2d04d21d1e24341948a41 /plugins/Actions
parent6a505441d26513aef2c1937d9be7ecb632eaf020 (diff)
Refactor archivers to support multiple idsites (#13168)
* refactor archivers to support multiple idsites * added a test to ensure multiple sites work * add comment
Diffstat (limited to 'plugins/Actions')
-rw-r--r--plugins/Actions/Archiver.php24
1 files changed, 8 insertions, 16 deletions
diff --git a/plugins/Actions/Archiver.php b/plugins/Actions/Archiver.php
index af84c385a6..f49e4e15c5 100644
--- a/plugins/Actions/Archiver.php
+++ b/plugins/Actions/Archiver.php
@@ -161,10 +161,8 @@ class Archiver extends \Piwik\Plugin\Archiver
)
);
- $where = "log_link_visit_action.server_time >= ?
- AND log_link_visit_action.server_time <= ?
- AND log_link_visit_action.idsite = ?
- AND log_link_visit_action.%s IS NOT NULL"
+ $where = $this->getLogAggregator()->getWhereStatement('log_link_visit_action', 'server_time');
+ $where .= " AND log_link_visit_action.%s IS NOT NULL"
. $this->getWhereClauseActionIsNotEvent();
$groupBy = "log_link_visit_action.%s";
@@ -285,10 +283,8 @@ class Archiver extends \Piwik\Plugin\Archiver
sum(log_visit.visit_total_time) as `" . PiwikMetrics::INDEX_PAGE_ENTRY_SUM_VISIT_LENGTH . "`,
sum(case log_visit.visit_total_actions when 1 then 1 when 0 then 1 else 0 end) as `" . PiwikMetrics::INDEX_PAGE_ENTRY_BOUNCE_COUNT . "`";
- $where = "log_visit.visit_last_action_time >= ?
- AND log_visit.visit_last_action_time <= ?
- AND log_visit.idsite = ?
- AND log_visit.%s > 0";
+ $where = $this->getLogAggregator()->getWhereStatement('log_visit', 'visit_last_action_time');
+ $where .= " AND log_visit.%s > 0";
$groupBy = "log_visit.%s";
@@ -330,10 +326,8 @@ class Archiver extends \Piwik\Plugin\Archiver
count(distinct log_visit.idvisitor) as `" . PiwikMetrics::INDEX_PAGE_EXIT_NB_UNIQ_VISITORS . "`,
count(*) as `" . PiwikMetrics::INDEX_PAGE_EXIT_NB_VISITS . "`";
- $where = "log_visit.visit_last_action_time >= ?
- AND log_visit.visit_last_action_time <= ?
- AND log_visit.idsite = ?
- AND log_visit.%s > 0";
+ $where = $this->getLogAggregator()->getWhereStatement('log_visit', 'visit_last_action_time');
+ $where .= " AND log_visit.%s > 0";
$groupBy = "log_visit.%s";
@@ -374,10 +368,8 @@ class Archiver extends \Piwik\Plugin\Archiver
$select = "log_link_visit_action.%s as idaction, $extraSelects
sum(log_link_visit_action.time_spent_ref_action) as `" . PiwikMetrics::INDEX_PAGE_SUM_TIME_SPENT . "`";
- $where = "log_link_visit_action.server_time >= ?
- AND log_link_visit_action.server_time <= ?
- AND log_link_visit_action.idsite = ?
- AND log_link_visit_action.time_spent_ref_action > 0
+ $where = $this->getLogAggregator()->getWhereStatement('log_link_visit_action', 'server_time');
+ $where .= " AND log_link_visit_action.time_spent_ref_action > 0
AND log_link_visit_action.%s > 0"
. $this->getWhereClauseActionIsNotEvent();