Explorar o código

markscore avg

xjc hai 4 meses
pai
achega
cba6814552
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/weixin/controls.py

+ 2 - 1
src/weixin/controls.py

@@ -3769,7 +3769,8 @@ def get_user_markscore_week_avg(request):
     msret = msret.values("stock_date").distinct()
     for item in msret:
         qset = cm.UserMarkScore.objects.filter(stock_date=item['stock_date']).aggregate(avg_score=Avg("score"))
-        data.append({"stock_date":item['stock_date'],"avg_score":qset.get("avg_score",0)})
+        avg_score = "{}".format(round(qset.get("avg_score",0),1))
+        data.append({"stock_date":item['stock_date'],"avg_score":avg_score})
     # for i in range(1,5):
     #     item_list = []
     #     for j in range(1,8):