Ver código fonte

markscore avg

xjc 4 meses atrás
pai
commit
61ad585d34
1 arquivos alterados com 1 adições e 0 exclusões
  1. 1 0
      src/weixin/controls.py

+ 1 - 0
src/weixin/controls.py

@@ -3766,6 +3766,7 @@ def get_user_markscore_week_avg(request):
     # now = datetime.datetime.now().date()
     data = []
     msret = cm.UserMarkScore.objects.all().order_by('-stock_date').values()
+    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)})