@@ -129,7 +129,8 @@ public static function getLoginCountPerDay($days)
129129 "SELECT year, month, day, SUM(count) AS count " .
130130 "FROM " . $ table_name . " " .
131131 "WHERE service != '' " .
132- "GROUP BY year DESC,month DESC,day DESC "
132+ "GROUP BY year,month,day " .
133+ "ORDER BY year ASC,month ASC,day ASC "
133134 );
134135 } else {
135136 $ stmt = $ conn ->prepare (
@@ -138,7 +139,8 @@ public static function getLoginCountPerDay($days)
138139 "WHERE service != '' AND " .
139140 "CONCAT(year,'-',LPAD(month,2,'00'),'-',LPAD(day,2,'00')) " .
140141 "BETWEEN CURDATE() - INTERVAL ? DAY AND CURDATE() " .
141- "GROUP BY year DESC,month DESC,day DESC "
142+ "GROUP BY year,month,day " .
143+ "ORDER BY year ASC,month ASC,day ASC "
142144 );
143145 $ stmt ->bind_param ('d ' , $ days );
144146 }
@@ -160,7 +162,8 @@ public static function getLoginCountPerDayForService($days, $spIdentifier)
160162 "SELECT year, month, day, SUM(count) AS count " .
161163 "FROM " . $ table_name . " " .
162164 "WHERE service=? " .
163- "GROUP BY year DESC,month DESC,day DESC "
165+ "GROUP BY year,month,day " .
166+ "ORDER BY year ASC,month ASC,day ASC "
164167 );
165168 $ stmt ->bind_param ('s ' , $ spIdentifier );
166169 } else {
@@ -170,7 +173,8 @@ public static function getLoginCountPerDayForService($days, $spIdentifier)
170173 "WHERE service=? " .
171174 "AND CONCAT(year,'-',LPAD(month,2,'00'),'-',LPAD(day,2,'00')) " .
172175 "BETWEEN CURDATE() - INTERVAL ? DAY AND CURDATE() " .
173- "GROUP BY year DESC,month DESC,day DESC "
176+ "GROUP BY year,month,day " .
177+ "ORDER BY year ASC,month ASC,day ASC "
174178 );
175179 $ stmt ->bind_param ('sd ' , $ spIdentifier , $ days );
176180 }
@@ -192,7 +196,8 @@ public static function getLoginCountPerDayForIdp($days, $idpIdentifier)
192196 "SELECT year, month, day, SUM(count) AS count " .
193197 "FROM " . $ table_name . " " .
194198 "WHERE sourceIdP=? " .
195- "GROUP BY year DESC,month DESC,day DESC "
199+ "GROUP BY year,month,day " .
200+ "ORDER BY year ASC,month ASC,day ASC "
196201 );
197202 $ stmt ->bind_param ('s ' , $ idpIdentifier );
198203 } else {
@@ -202,7 +207,8 @@ public static function getLoginCountPerDayForIdp($days, $idpIdentifier)
202207 "WHERE sourceIdP=? " .
203208 "AND CONCAT(year,'-',LPAD(month,2,'00'),'-',LPAD(day,2,'00')) " .
204209 "BETWEEN CURDATE() - INTERVAL ? DAY AND CURDATE() " .
205- "GROUP BY year DESC,month DESC,day DESC "
210+ "GROUP BY year,month,day " .
211+ "ORDER BY year ASC,month ASC,day ASC "
206212 );
207213 $ stmt ->bind_param ('sd ' , $ idpIdentifier , $ days );
208214 }
0 commit comments