瀏覽代碼

markscore avg

xjc 4 月之前
父節點
當前提交
61ad585d34
共有 1 個文件被更改,包括 1 次插入0 次删除
  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)})