From b561f7eec86f0e5bdd07909b18aa27c7af128b83 Mon Sep 17 00:00:00 2001 From: "Fedor A. Fetisov" Date: Thu, 5 Oct 2017 11:38:43 +0300 Subject: [PATCH] Make statistics compatible with the default MySQL 5.7 settings See https://mibew.org/forums/index.php/topic,192176.msg199690 for details --- src/mibew/libs/statistics.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mibew/libs/statistics.php b/src/mibew/libs/statistics.php index 45422c40..7aef1c56 100644 --- a/src/mibew/libs/statistics.php +++ b/src/mibew/libs/statistics.php @@ -52,7 +52,6 @@ function get_by_date_statistics($start, $end) . "FROM {threadstatistics} s " . "WHERE s.date >= :start " . "AND s.date < :end " - . "GROUP BY DATE(FROM_UNIXTIME(date)) " . "ORDER BY s.date DESC"), array( ':start' => $start, @@ -63,8 +62,7 @@ function get_by_date_statistics($start, $end) // Get statistics aggregated for all accessed interval $total = $db->query( - ("SELECT DATE(FROM_UNIXTIME(date)) AS date, " - . "SUM(threads) AS threads, " + ("SELECT SUM(threads) AS threads, " . "SUM(missedthreads) AS missedthreads, " . "SUM(sentinvitations) AS sentinvitations, " . "SUM(acceptedinvitations) AS acceptedinvitations, " @@ -116,7 +114,7 @@ function get_by_operator_statistics($start, $end) . "WHERE s.operatorid = o.operatorid " . "AND s.date >= :start " . "AND s.date < :end " - . "GROUP BY s.operatorid"), + . "GROUP BY s.operatorid, o.vclocalename"), array( ':start' => $start, ':end' => $end,