chanjunkai 5 жил өмнө
parent
commit
9e84daae38

+ 1 - 1
Controller/Alexa.py

@@ -96,7 +96,7 @@ class AlexaConnectNum(TemplateView):
         #最近十二个月每月最高连接数
         #最近十二个月每月最高连接数
         if operation == 'years':
         if operation == 'years':
             cursor=connection.cursor()
             cursor=connection.cursor()
-            cursor.execute("SELECT FROM_UNIXTIME(data_time,'%Y-%m') as month, max(num) as max_num FROM alexa_statistics GROUP BY month order by month asc")
+            cursor.execute("SELECT FROM_UNIXTIME(data_time,'%Y-%m') as month, max(num) as max_num FROM alexa_statistics GROUP BY month order by month asc LIMIT 12")
             res_query = cursor.fetchall()
             res_query = cursor.fetchall()
             for max_num, month in res_query:
             for max_num, month in res_query:
                 res.append({'num':max_num, 'month':month})
                 res.append({'num':max_num, 'month':month})