fix mysql8 issue with group by and sorting within; fixes #774
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -112,11 +112,14 @@ if (! is_null($month) && ! is_null($year)) {
|
|||||||
|
|
||||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_details') . "\";");
|
eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_details') . "\";");
|
||||||
} else {
|
} else {
|
||||||
$result_stmt = Database::prepare("SELECT `month`, `year`, SUM(`http`) AS http, SUM(`ftp_up`) AS ftp_up, SUM(`ftp_down`) AS ftp_down, SUM(`mail`) AS mail
|
$result_stmt = Database::prepare("
|
||||||
|
SELECT `month`, `year`, SUM(`http`) AS http, SUM(`ftp_up`) AS ftp_up, SUM(`ftp_down`) AS ftp_down, SUM(`mail`) AS mail
|
||||||
FROM `" . TABLE_PANEL_TRAFFIC . "`
|
FROM `" . TABLE_PANEL_TRAFFIC . "`
|
||||||
WHERE `customerid` = :customerid
|
WHERE `customerid` = :customerid
|
||||||
GROUP BY `year` DESC, `month` DESC
|
GROUP BY `year`, `month`
|
||||||
LIMIT 12");
|
ORDER BY `year` DESC, `month` DESC
|
||||||
|
LIMIT 12
|
||||||
|
");
|
||||||
Database::pexecute($result_stmt, array(
|
Database::pexecute($result_stmt, array(
|
||||||
"customerid" => $userinfo['customerid']
|
"customerid" => $userinfo['customerid']
|
||||||
));
|
));
|
||||||
|
|||||||
Reference in New Issue
Block a user