feat(web/user_info): display problem title

This commit is contained in:
Baoshuo Ren 2022-03-24 13:30:00 +08:00
parent cb1a6f33f4
commit b27965dec8
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -77,13 +77,13 @@
<div class="list-group"> <div class="list-group">
<div class="list-group-item"> <div class="list-group-item">
<?php <?php
$ac_problems = DB::selectAll("select problem_id from best_ac_submissions where submitter = '{$user['username']}'"); $ac_problems = DB::selectAll("select a.problem_id as problem_id, b.title as title from best_ac_submissions a inner join problems b on a.problem_id = b.id where submitter = '{$user['username']}';");
?> ?>
<h4 class="list-group-item-heading"><?= UOJLocale::get('accepted problems').''.UOJLocale::get('n problems in total', count($ac_problems))?> </h4> <h4 class="list-group-item-heading"><?= UOJLocale::get('accepted problems').''.UOJLocale::get('n problems in total', count($ac_problems))?> </h4>
<p class="list-group-item-text"> <p class="list-group-item-text">
<?php <?php
foreach ($ac_problems as $problem) { foreach ($ac_problems as $problem) {
echo '<a href="/problem/', $problem['problem_id'], '" style="display:inline-block; width:4em;">', $problem['problem_id'], '</a>'; echo '<a href="/problem/', $problem['problem_id'], '" style="display:inline-block; margin-right:0.25em;">#', $problem['problem_id'], '. ', $problem['title'], '</a>';
} }
if (empty($ac_problems)) { if (empty($ac_problems)) {
echo UOJLocale::get('none'); echo UOJLocale::get('none');