diff options
Diffstat (limited to 'plugins/Live/Model.php')
-rw-r--r-- | plugins/Live/Model.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/Live/Model.php b/plugins/Live/Model.php index 4ec45dc59a..de2587c96e 100644 --- a/plugins/Live/Model.php +++ b/plugins/Live/Model.php @@ -12,6 +12,7 @@ namespace Piwik\Plugins\Live; use Exception; use Piwik\API\Request; use Piwik\Common; +use Piwik\Container\StaticContainer; use Piwik\Date; use Piwik\Db; use Piwik\Period; @@ -127,8 +128,10 @@ class Model list($whereIdSites, $idSites) = $this->getIdSitesWhereClause($idSite, $from); + $now = StaticContainer::get('Tests.now') ?: time(); + $bind = $idSites; - $bind[] = Date::factory(time() - $lastMinutes * 60)->toString('Y-m-d H:i:s'); + $bind[] = Date::factory($now - $lastMinutes * 60)->toString('Y-m-d H:i:s'); $where = $whereIdSites . "AND " . $where; |