Make statistics compatible with the default MySQL 5.7 settings

See
https://mibew.org/forums/index.php/topic,192176.msg199690 for details
This commit is contained in:
Fedor A. Fetisov 2017-10-05 11:38:43 +03:00
parent 393bf21f30
commit b561f7eec8

View File

@ -52,7 +52,6 @@ function get_by_date_statistics($start, $end)
. "FROM {threadstatistics} s " . "FROM {threadstatistics} s "
. "WHERE s.date >= :start " . "WHERE s.date >= :start "
. "AND s.date < :end " . "AND s.date < :end "
. "GROUP BY DATE(FROM_UNIXTIME(date)) "
. "ORDER BY s.date DESC"), . "ORDER BY s.date DESC"),
array( array(
':start' => $start, ':start' => $start,
@ -63,8 +62,7 @@ function get_by_date_statistics($start, $end)
// Get statistics aggregated for all accessed interval // Get statistics aggregated for all accessed interval
$total = $db->query( $total = $db->query(
("SELECT DATE(FROM_UNIXTIME(date)) AS date, " ("SELECT SUM(threads) AS threads, "
. "SUM(threads) AS threads, "
. "SUM(missedthreads) AS missedthreads, " . "SUM(missedthreads) AS missedthreads, "
. "SUM(sentinvitations) AS sentinvitations, " . "SUM(sentinvitations) AS sentinvitations, "
. "SUM(acceptedinvitations) AS acceptedinvitations, " . "SUM(acceptedinvitations) AS acceptedinvitations, "
@ -116,7 +114,7 @@ function get_by_operator_statistics($start, $end)
. "WHERE s.operatorid = o.operatorid " . "WHERE s.operatorid = o.operatorid "
. "AND s.date >= :start " . "AND s.date >= :start "
. "AND s.date < :end " . "AND s.date < :end "
. "GROUP BY s.operatorid"), . "GROUP BY s.operatorid, o.vclocalename"),
array( array(
':start' => $start, ':start' => $start,
':end' => $end, ':end' => $end,