mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-09 23:08:42 +00:00
fix(web/contest/after_contest_standings): only fetch data of contestants who has participated in the contest
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
079c405277
commit
ba267c15e1
@ -153,6 +153,13 @@ function queryOIorIOIContestSubmissionData($contest, $problems, $prob_pos, $conf
|
||||
"select id, submit_time, submitter, problem_id, score from submissions",
|
||||
"where", [
|
||||
["problem_id", "in", DB::rawtuple($problems)],
|
||||
["submitter", "in", DB::rawbracket([
|
||||
"select username from contests_registrants",
|
||||
"where", [
|
||||
"contest_id" => $contest['id'],
|
||||
"has_participated" => 1,
|
||||
],
|
||||
])],
|
||||
], "order by score",
|
||||
], DB::NUM);
|
||||
} else {
|
||||
|
@ -15,8 +15,8 @@
|
||||
var person = score[key];
|
||||
|
||||
if (person[i] === undefined) return;
|
||||
if (person[i][0] === 100 && (first_accepted[i] === undefined || first_accepted[i][1] > person[i][2])) {
|
||||
first_accepted[i] = [person[i][1], person[i][2]];
|
||||
if (person[i][0] === 100 && (!first_accepted[i] || first_accepted[i] > person[i][2])) {
|
||||
first_accepted[i] = person[i][2];
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -40,7 +40,7 @@
|
||||
for (var i = 0; i < problems.length; i++) {
|
||||
col = score[row[2][0]][i];
|
||||
if (col != undefined) {
|
||||
col_tr += first_accepted[i] !== undefined && col[2] === first_accepted[i][1] ? '<td class="table-success"' : '<td>';
|
||||
col_tr += col[2] === first_accepted[i] ? '<td class="table-success">' : '<td>';
|
||||
col_tr += '<div>';
|
||||
|
||||
if (col[2]) col_tr += '<a href="/submission/' + col[2] + '" class="uoj-score" style="color:' + getColOfScore(col[0]) + '">' + col[0] + '</a>';
|
||||
|
Loading…
Reference in New Issue
Block a user