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:
authorStefan Giehl <stefan@matomo.org>2020-07-10 01:41:19 +0300
committerGitHub <noreply@github.com>2020-07-10 01:41:19 +0300
commitd72b8bf705dabcdbd4d00876b2a3be9f58056e61 (patch)
tree818b198fbf5bd7e0a4207c7963bb30612c7f35c2 /plugins/Live
parentb0553730a95c5b6cd7408c5834ba8acd029c7375 (diff)
Fix behaviour for segments using "not equals" or "not contains" on an action dimension (#16172)
Diffstat (limited to 'plugins/Live')
-rw-r--r--plugins/Live/Model.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/Live/Model.php b/plugins/Live/Model.php
index 9590cf00e3..023d716983 100644
--- a/plugins/Live/Model.php
+++ b/plugins/Live/Model.php
@@ -359,11 +359,12 @@ class Model
$now = $now ?: time();
$bind = $idSites;
- $bind[] = Date::factory($now - $lastMinutes * 60)->toString('Y-m-d H:i:s');
+ $startDate = Date::factory($now - $lastMinutes * 60);
+ $bind[] = $startDate->toString('Y-m-d H:i:s');
$where = $whereIdSites . "AND " . $where;
- $segment = new Segment($segment, $idSite);
+ $segment = new Segment($segment, $idSite, $startDate, $endDate = null);
$query = $segment->getSelectQuery($select, $from, $where, $bind);
$numVisitors = Db::getReader()->fetchOne($query['sql'], $query['bind']);
@@ -428,7 +429,7 @@ class Model
$orderBy = "MAX(log_visit.visit_last_action_time) $orderByDir";
$groupBy = "log_visit.idvisitor";
- $segment = new Segment($segment, $idSite);
+ $segment = new Segment($segment, $idSite, $dateOneDayAgo, $dateOneDayInFuture);
$queryInfo = $segment->getSelectQuery($select, $from, $where, $whereBind, $orderBy, $groupBy);
$sql = "SELECT sub.idvisitor, sub.visit_last_action_time FROM ({$queryInfo['sql']}) as sub
@@ -466,7 +467,7 @@ class Model
$filterSortOrder = 'DESC';
}
- $segment = new Segment($segment, $idSite);
+ $segment = new Segment($segment, $idSite, $startDate, $endDate);
// Subquery to use the indexes for ORDER BY
$select = "log_visit.*";