Explorar o código

markscore avg

xjc hai 4 meses
pai
achega
61ad585d34
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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)})