mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-12-25 04:11:52 +00:00
fix(group): hide hidden submissions
This commit is contained in:
parent
fea4eea8d7
commit
aa4a2fa2d1
@ -64,18 +64,15 @@ UOJGroup::cur()->userCanView(Auth::user(), ['ensure' => true]);
|
||||
<?= UOJLocale::get('news') ?>
|
||||
</h2>
|
||||
<ul class="mb-0">
|
||||
<?php foreach (UOJGroup::cur()->getLatestGroupmatesAcceptedSubmissionIds(Auth::user()) as $id) : ?>
|
||||
<?php
|
||||
$submission = UOJSubmission::query($id);
|
||||
$submission->setProblem();
|
||||
$user = UOJUser::query($submission->info['submitter']);
|
||||
?>
|
||||
<li>
|
||||
<?= UOJUser::getLink($user) ?>
|
||||
解决了问题
|
||||
<?= $submission->problem->getLink(['with' => 'id']) ?>
|
||||
(<time><?= $submission->info['submit_time'] ?></time>)
|
||||
</li>
|
||||
<?php foreach (UOJGroup::cur()->getLatestGroupMatesAcceptedSubmissions(Auth::user()) as $submission) : ?>
|
||||
<?php if ($submission->userCanView(Auth::user())) : ?>
|
||||
<li>
|
||||
<?= UOJUser::getLink($submission->info['submitter']) ?>
|
||||
解决了问题
|
||||
<?= $submission->problem->getLink(['with' => 'id']) ?>
|
||||
(<time><?= $submission->info['submit_time'] ?></time>)
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -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", [
|
||||
|
Loading…
Reference in New Issue
Block a user