From aa4a2fa2d16a7a831b5da3cbc39f8b2ef71bb3cb Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Mon, 13 Feb 2023 11:34:43 +0800 Subject: [PATCH] fix(group): hide hidden submissions --- web/app/controllers/group.php | 21 +++++++++------------ web/app/models/UOJGroup.php | 9 +++++++-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/web/app/controllers/group.php b/web/app/controllers/group.php index 1a4f9a4..d420f38 100644 --- a/web/app/controllers/group.php +++ b/web/app/controllers/group.php @@ -64,18 +64,15 @@ UOJGroup::cur()->userCanView(Auth::user(), ['ensure' => true]); diff --git a/web/app/models/UOJGroup.php b/web/app/models/UOJGroup.php index 2c22d3f..42baecd 100644 --- a/web/app/models/UOJGroup.php +++ b/web/app/models/UOJGroup.php @@ -86,8 +86,13 @@ class UOJGroup { ])); } - public function getLatestGroupmatesAcceptedSubmissionIds(array $user = null, int $limit = 10) { - return array_map(fn ($x) => $x['id'], DB::selectAll([ + public function getLatestGroupMatesAcceptedSubmissions(array $user = null, int $limit = 10) { + return array_map(function ($x) { + $submission = UOJSubmission::query($x['id']); + $submission->setProblem(); + + return $submission; + }, DB::selectAll([ "select", DB::fields(["id" => "max(id)"]), "from submissions", "where", [