From 9111c61ce69443e19d141eda00b0e7224903f1c2 Mon Sep 17 00:00:00 2001 From: jmontoya Date: Mon, 14 Mar 2016 12:15:40 +0100 Subject: [PATCH] Fix group by . --- main/inc/lib/tracking.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/inc/lib/tracking.lib.php b/main/inc/lib/tracking.lib.php index e7840906d1..44a4049a74 100755 --- a/main/inc/lib/tracking.lib.php +++ b/main/inc/lib/tracking.lib.php @@ -2186,11 +2186,13 @@ class Tracking " lp_view.lp_id IN(" . implode(', ', $filteredLP) . ") " ]; + $groupBy = 'GROUP BY lp_id'; + if (is_array($studentId)) { $studentId = array_map('intval', $studentId); $conditions[] = " lp_view.user_id IN (" . implode(',', $studentId) . ") "; - $groupBy = 'GROUP BY lp_id'; + } else { $studentId = intval($studentId); $conditions[] = " lp_view.user_id = '$studentId' "; @@ -2205,8 +2207,6 @@ class Tracking } } } - - $groupBy = 'GROUP BY user_id'; } if (!empty($sessionId)) {