From aed0b04cb5a19a3ea2473585146875f827fa53b8 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Sat, 22 Oct 2022 06:42:43 +0800 Subject: [PATCH] fix: 892a56a88198f4c1fdd3ec407014fbe80346f84e --- web/app/controllers/group_assignment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app/controllers/group_assignment.php b/web/app/controllers/group_assignment.php index 0964848..e1e3f3c 100644 --- a/web/app/controllers/group_assignment.php +++ b/web/app/controllers/group_assignment.php @@ -52,7 +52,7 @@ $usernames = []; $n_users = count($users); $n_problems = count($problems); - $submission_end_time = min(new DateTime(), DateTime::createFromFormat('Y-m-d H:i:s', $assignment['end_time']))->format('Y-m-d H:i:s'); + $submission_end_time = min(new DateTime(), DateTime::createFromFormat('Y-m-d H:i:s', $assignment['end_time']))->getTimestamp(); foreach ($problems as $problem) { $problem_ids[] = $problem['problem_id']; @@ -77,7 +77,7 @@ ]; foreach ($problem_ids as $problem_id) { - $cond = "submitter = '{$user['username']}' AND problem_id = $problem_id AND submit_time <= '$submission_end_time'"; + $cond = "submitter = '{$user['username']}' AND problem_id = $problem_id AND unix_timestamp(submit_time) <= $submission_end_time"; $max_score_query = DB::selectFirst("SELECT MAX(score) AS score FROM submissions WHERE $cond"); if ($max_score_query) { $max_score = $max_score_query['score'];