mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-24 18:08:41 +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') ?>
|
<?= UOJLocale::get('news') ?>
|
||||||
</h2>
|
</h2>
|
||||||
<ul class="mb-0">
|
<ul class="mb-0">
|
||||||
<?php foreach (UOJGroup::cur()->getLatestGroupmatesAcceptedSubmissionIds(Auth::user()) as $id) : ?>
|
<?php foreach (UOJGroup::cur()->getLatestGroupMatesAcceptedSubmissions(Auth::user()) as $submission) : ?>
|
||||||
<?php
|
<?php if ($submission->userCanView(Auth::user())) : ?>
|
||||||
$submission = UOJSubmission::query($id);
|
<li>
|
||||||
$submission->setProblem();
|
<?= UOJUser::getLink($submission->info['submitter']) ?>
|
||||||
$user = UOJUser::query($submission->info['submitter']);
|
解决了问题
|
||||||
?>
|
<?= $submission->problem->getLink(['with' => 'id']) ?>
|
||||||
<li>
|
(<time><?= $submission->info['submit_time'] ?></time>)
|
||||||
<?= UOJUser::getLink($user) ?>
|
</li>
|
||||||
解决了问题
|
<?php endif ?>
|
||||||
<?= $submission->problem->getLink(['with' => 'id']) ?>
|
|
||||||
(<time><?= $submission->info['submit_time'] ?></time>)
|
|
||||||
</li>
|
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -86,8 +86,13 @@ class UOJGroup {
|
|||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLatestGroupmatesAcceptedSubmissionIds(array $user = null, int $limit = 10) {
|
public function getLatestGroupMatesAcceptedSubmissions(array $user = null, int $limit = 10) {
|
||||||
return array_map(fn ($x) => $x['id'], DB::selectAll([
|
return array_map(function ($x) {
|
||||||
|
$submission = UOJSubmission::query($x['id']);
|
||||||
|
$submission->setProblem();
|
||||||
|
|
||||||
|
return $submission;
|
||||||
|
}, DB::selectAll([
|
||||||
"select", DB::fields(["id" => "max(id)"]),
|
"select", DB::fields(["id" => "max(id)"]),
|
||||||
"from submissions",
|
"from submissions",
|
||||||
"where", [
|
"where", [
|
||||||
|
Loading…
Reference in New Issue
Block a user