update
This commit is contained in:
parent
b28dcc9aa7
commit
793eff3fd6
25
main.py
25
main.py
@ -893,12 +893,22 @@ async def get_programs_scores(data: dict):
|
||||
placeholders = ','.join(['?' for _ in sn_list])
|
||||
cursor.execute(
|
||||
f"""
|
||||
SELECT program_sn, judge_id,
|
||||
COALESCE(admin_total_score,
|
||||
COALESCE(content_score,0) + COALESCE(stage_score,0) +
|
||||
COALESCE(art_score,0) + COALESCE(overall_score,0)
|
||||
) AS final_total
|
||||
FROM scores WHERE program_sn IN ({placeholders})
|
||||
SELECT
|
||||
program_sn,
|
||||
judge_id,
|
||||
CASE
|
||||
WHEN (admin_total_score IS NOT NULL OR
|
||||
content_score IS NOT NULL OR
|
||||
stage_score IS NOT NULL OR
|
||||
art_score IS NOT NULL OR
|
||||
overall_score IS NOT NULL)
|
||||
THEN COALESCE(admin_total_score,
|
||||
COALESCE(content_score,0) + COALESCE(stage_score,0) +
|
||||
COALESCE(art_score,0) + COALESCE(overall_score,0))
|
||||
ELSE NULL
|
||||
END AS final_total
|
||||
FROM scores
|
||||
WHERE program_sn IN ({placeholders})
|
||||
""",
|
||||
sn_list,
|
||||
)
|
||||
@ -1937,7 +1947,8 @@ HTML_TEMPLATE = """
|
||||
const progScores = scoresMap[prog.sn];
|
||||
if(progScores && progScores[judge.id] !== undefined && progScores[judge.id] !== null)
|
||||
score = progScores[judge.id];
|
||||
html += `<td><input type="number" class="score-input" id="score_${prog.sn}_${judge.id}" value="${score}" step="0.5" min="0" max="100"></td>`;
|
||||
let scoreValue = (score !== null && score !== undefined) ? score : '';
|
||||
html += `<td><input type="number" class="score-input" id="score_${prog.sn}_${judge.id}" value="${scoreValue}" step="0.5" min="0" max="100"></td>`;
|
||||
}
|
||||
html += `<td><button class="btn btn-outline btn-sm" onclick="printProgram('${prog.sn}')">🖨️ 打印评分</button></td></tr>`;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user