From e5939d359238005644238715b7fbfdede9041d0a Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Mon, 14 Apr 2025 12:18:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E8=B7=83=E7=94=A8=E6=88=B7=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E4=B8=A4=E5=B9=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problem/views/oj.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/problem/views/oj.py b/problem/views/oj.py index 43808d9..d360858 100644 --- a/problem/views/oj.py +++ b/problem/views/oj.py @@ -165,14 +165,14 @@ class ProblemSolvedPeopleCount(APIView): if submission_count == 0: return self.success("0%") today = datetime.today() - oneYearAge = datetime(today.year - 1, today.month, today.day, 0, 0) + twoYearAge = datetime(today.year - 2, today.month, today.day, 0, 0) total_count = User.objects.filter( - is_disabled=False, last_login__gte=oneYearAge + is_disabled=False, last_login__gte=twoYearAge ).count() accepted_count = Submission.objects.filter( problem_id=problem_id, result=JudgeStatus.ACCEPTED, - create_time__gte=oneYearAge, + create_time__gte=twoYearAge, ).aggregate(user_count=Count("user_id", distinct=True))["user_count"] if accepted_count < total_count: rate = "%.2f" % ((total_count - accepted_count) / total_count * 100)