fix: d7f5d58eb7
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2023-02-14 22:17:26 +08:00
parent d7f5d58eb7
commit ebeed712bf
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -281,7 +281,7 @@
<?php <?php
$ac_records = DB::selectAll([ $ac_records = DB::selectAll([
"select", DB::bracketed_fields([ "select", DB::fields([
"submit_time" => "date_format(submit_time, '%Y-%m-%d')", "submit_time" => "date_format(submit_time, '%Y-%m-%d')",
"problem_id", "problem_id",
]), ]),
@ -293,14 +293,12 @@
] ]
]); ]);
$last_year_ac_cnt_by_day = []; $last_year_ac_cnt_by_day = [];
$last_year_ac_cnt = 0;
foreach ($ac_records as $record) { foreach ($ac_records as $record) {
$last_year_ac_cnt++;
$last_year_ac_cnt_by_day[$record["submit_time"]]++; $last_year_ac_cnt_by_day[$record["submit_time"]]++;
} }
?> ?>
<div class="card mb-2"> <div class="card mb-2">
<div class="card-header fw-bold"><?= UOJLocale::get('n accepted in last year', $last_year_ac_cnt) ?></div> <div class="card-header fw-bold"><?= UOJLocale::get('n accepted in last year', count($ac_records)) ?></div>
<div class="card-body"> <div class="card-body">
<div id="accepted-graph" style="font-size: 14px"></div> <div id="accepted-graph" style="font-size: 14px"></div>
<script> <script>