|
@@ -3766,6 +3766,7 @@ def get_user_markscore_week_avg(request):
|
|
# now = datetime.datetime.now().date()
|
|
# now = datetime.datetime.now().date()
|
|
data = []
|
|
data = []
|
|
msret = cm.UserMarkScore.objects.all().order_by('-stock_date').values()
|
|
msret = cm.UserMarkScore.objects.all().order_by('-stock_date').values()
|
|
|
|
+ msret = msret.values("stock_date").distinct()
|
|
for item in msret:
|
|
for item in msret:
|
|
qset = cm.UserMarkScore.objects.filter(stock_date=item['stock_date']).aggregate(avg_score=Avg("score"))
|
|
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)})
|
|
data.append({"stock_date":item['stock_date'],"avg_score":qset.get("avg_score",0)})
|