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)