mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 18:08:42 +00:00
fix: user_info accepted submission count
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
ce10dce025
commit
e62f3b4d38
@ -131,16 +131,14 @@
|
|||||||
$_result = DB::query("select date_format(submit_time, '%Y-%m-%d'), problem_id from submissions where submitter = '{$username}' and score = 100 and date(submit_time) between date_sub(curdate(), interval 1 year) and curdate()");
|
$_result = DB::query("select date_format(submit_time, '%Y-%m-%d'), problem_id from submissions where submitter = '{$username}' and score = 100 and date(submit_time) between date_sub(curdate(), interval 1 year) and curdate()");
|
||||||
$result = [];
|
$result = [];
|
||||||
$vis = [];
|
$vis = [];
|
||||||
|
$cnt = 0;
|
||||||
while ($row = DB::fetch($_result)) {
|
while ($row = DB::fetch($_result)) {
|
||||||
$id = $row["date_format(submit_time, '%Y-%m-%d')"] . ':' . $row['problem_id'];
|
$cnt++;
|
||||||
if (!$vis[$id]) {
|
$result[$row["date_format(submit_time, '%Y-%m-%d')"]]++;
|
||||||
$vis[$id] = 1;
|
|
||||||
$result[$row["date_format(submit_time, '%Y-%m-%d')"]]++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<h4 class="card-title h5">
|
<h4 class="card-title h5">
|
||||||
<?= UOJLocale::get('n accepted in last year', count($result)) ?>
|
<?= UOJLocale::get('n accepted in last year', $cnt) ?>
|
||||||
</h4>
|
</h4>
|
||||||
<div id="accepted-graph" style="font-size: 14px"></div>
|
<div id="accepted-graph" style="font-size: 14px"></div>
|
||||||
<script>
|
<script>
|
||||||
|
Loading…
Reference in New Issue
Block a user