From c163103542e87fb616df2d5b804854eeff2c5ea0 Mon Sep 17 00:00:00 2001 From: "sxw@401" Date: Sat, 5 Sep 2015 18:54:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=AF=94=E8=B5=9B=E6=8E=92?= =?UTF-8?q?=E5=90=8D=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contest/views.py | 2 +- template/src/oj/contest/contest_rank.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contest/views.py b/contest/views.py index e23b50e..91aa8f7 100644 --- a/contest/views.py +++ b/contest/views.py @@ -396,7 +396,7 @@ def _cmp(x, y): def contest_rank_page(request, contest_id): contest = Contest.objects.get(id=contest_id) contest_problems = ContestProblem.objects.filter(contest=contest).order_by("sort_index") - result = ContestSubmission.objects.values("user_id").annotate(total_submit=Count("user_id")) + result = ContestSubmission.objects.values("user_id").annotate(total_submit=Sum("total_submission_number")) for i in range(0, len(result)): # 这个人所有的提交 submissions = ContestSubmission.objects.filter(user_id=result[i]["user_id"]) diff --git a/template/src/oj/contest/contest_rank.html b/template/src/oj/contest/contest_rank.html index 43c5444..823b021 100644 --- a/template/src/oj/contest/contest_rank.html +++ b/template/src/oj/contest/contest_rank.html @@ -38,7 +38,7 @@ {{ forloop.counter }} {{ item.user.username }} - {{ item.total_ac }} / {{ item.total_submission_number }} + {{ item.total_ac }} / {{ item.total_submit }} {% if item.total_time %}{{ item.total_time }} min{% else %}--{% endif %} {% for problem in contest_problems %}