Compare commits

...

2 Commits

Author SHA1 Message Date
519dbb8700
fix: 9c2b2a96ab
All checks were successful
continuous-integration/drone/push Build is passing
2022-09-20 20:00:27 +08:00
d9be3be581
feat: contests order 2022-09-20 19:44:40 +08:00
2 changed files with 12 additions and 5 deletions

View File

@ -60,7 +60,7 @@ EOD;
$table_header .= '<th style="width:100px;">'.UOJLocale::get('contests::the number of registrants').'</th>';
$table_header .= '<th style="width:180px;">'.UOJLocale::get('appraisal').'</th>';
$table_header .= '</tr>';
echoLongTable(array('*'), 'contests', "status != 'finished'", 'order by id desc', $table_header,
echoLongTable(array('*'), 'contests', "status != 'finished'", 'order by start_time desc, id desc', $table_header,
echoContest,
array('page_len' => 40)
);
@ -85,7 +85,7 @@ EOD;
<h4><?= UOJLocale::get('contests::ended contests') ?></h4>
<?php
echoLongTable(array('*'), 'contests', "status = 'finished'", 'order by id desc', $table_header,
echoLongTable(array('*'), 'contests', "status = 'finished'", 'order by start_time desc, id desc', $table_header,
echoContest,
array('page_len' => 40,
'print_after_table' => function() {

View File

@ -169,10 +169,17 @@ function calcStandings($contest, $contest_data, &$score, &$standings, $update_co
for ($i = 0; $i < $n_people; $i++) {
if ($i == 0 || !$is_same_rank($standings[$i - 1], $standings[$i])) {
$standings[$i][] = $standings[$i][3];
$standings[$i][3] = $i + 1;
if ($show_reviews) {
$standings[$i][] = $standings[$i][3];
$standings[$i][3] = $i + 1;
} else {
$standings[$i][] = $i + 1;
}
} else {
$standings[$i][] = $standings[$i][3];
if ($show_reviews) {
$standings[$i][] = $standings[$i][3];
}
$standings[$i][] = $standings[$i - 1][3];
}
}