diff options
Diffstat (limited to 'core/ArchiveProcessing/Day.php')
-rw-r--r-- | core/ArchiveProcessing/Day.php | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/core/ArchiveProcessing/Day.php b/core/ArchiveProcessing/Day.php index 5193a39562..df823b978b 100644 --- a/core/ArchiveProcessing/Day.php +++ b/core/ArchiveProcessing/Day.php @@ -44,12 +44,12 @@ class Piwik_ArchiveProcessing_Day extends Piwik_ArchiveProcessing sum(case visit_total_actions when 1 then 1 else 0 end) as bounce_count, sum(case visit_goal_converted when 1 then 1 else 0 end) as nb_visits_converted FROM ".$this->logTable." - WHERE visit_last_action_time >= ? - AND visit_last_action_time <= ? + WHERE visit_server_date = ? AND idsite = ? + GROUP BY visit_server_date ORDER BY NULL"; - $row = $this->db->fetchRow($query, array($this->getStartDatetimeUTC(), $this->getEndDatetimeUTC(), $this->idsite ) ); - if($row === false || $row === null || $row['nb_visits'] == 0) + $row = $this->db->fetchRow($query, array($this->strDateStart,$this->idsite ) ); + if($row === false || $row === null) { return; } @@ -87,10 +87,9 @@ class Piwik_ArchiveProcessing_Day extends Piwik_ArchiveProcessing { $query = "SELECT $select FROM ".$this->logTable." - WHERE visit_last_action_time >= ? - AND visit_last_action_time <= ? - AND idsite = ?"; - $data = $this->db->fetchRow($query, array( $this->getStartDatetimeUTC(), $this->getEndDatetimeUTC(), $this->idsite )); + WHERE visit_server_date = ? + AND idsite = ?"; + $data = $this->db->fetchRow($query, array( $this->strDateStart, $this->idsite )); foreach($data as $label => &$count) { @@ -153,12 +152,11 @@ class Piwik_ArchiveProcessing_Day extends Piwik_ArchiveProcessing sum(case visit_total_actions when 1 then 1 else 0 end) as bounce_count, sum(case visit_goal_converted when 1 then 1 else 0 end) as nb_visits_converted FROM ".$this->logTable." - WHERE visit_last_action_time >= ? - AND visit_last_action_time <= ? - AND idsite = ? + WHERE visit_server_date = ? + AND idsite = ? GROUP BY label ORDER BY NULL"; - $query = $this->db->query($query, array( $this->getStartDatetimeUTC(), $this->getEndDatetimeUTC(), $this->idsite ) ); + $query = $this->db->query($query, array( $this->strDateStart, $this->idsite ) ); $interest = array(); while($row = $query->fetch()) @@ -329,12 +327,11 @@ class Piwik_ArchiveProcessing_Day extends Piwik_ArchiveProcessing sum(revenue) as revenue $segments FROM ".$this->logConversionTable." - WHERE server_time >= ? - AND server_time <= ? - AND idsite = ? + WHERE visit_server_date = ? + AND idsite = ? GROUP BY idgoal $segments ORDER BY NULL"; - $query = $this->db->query($query, array( $this->getStartDatetimeUTC(), $this->getEndDatetimeUTC(), $this->idsite )); + $query = $this->db->query($query, array( $this->strDateStart, $this->idsite )); return $query; } @@ -345,20 +342,15 @@ class Piwik_ArchiveProcessing_Day extends Piwik_ArchiveProcessing sum(revenue) as revenue, $segment as label FROM ".$this->logConversionTable." - WHERE server_time >= ? - AND server_time <= ? - AND idsite = ? + WHERE visit_server_date = ? + AND idsite = ? GROUP BY idgoal, label ORDER BY NULL"; - $query = $this->db->query($query, array( $this->getStartDatetimeUTC(), $this->getEndDatetimeUTC(), $this->idsite )); + $query = $this->db->query($query, array( $this->strDateStart, $this->idsite )); return $query; } /** - * Given an array of stats, it will process the sum of goal conversions - * and sum of revenue and add it in the stats array in two new fields. - * - * @param $interestByLabel Passed by reference, it will be modified as follows: * Input: * array( * LABEL => array( Piwik_Archive::INDEX_NB_VISITS => X, @@ -370,12 +362,10 @@ class Piwik_ArchiveProcessing_Day extends Piwik_ArchiveProcessing * LABEL2 => array( Piwik_Archive::INDEX_NB_VISITS => Y, [...] ) * ); * - * * Output: * array( * LABEL => array( Piwik_Archive::INDEX_NB_VISITS => X, - * Piwik_Archive::INDEX_NB_CONVERSIONS => Y, // sum of all conversions - * Piwik_Archive::INDEX_REVENUE => Z, // sum of all revenue + * * Piwik_Archive::INDEX_GOALS => array( * idgoal1 => array( [...] ), * idgoal2 => array( [...] ), |