diff --git a/main.py b/main.py index d522ff7..873a190 100644 --- a/main.py +++ b/main.py @@ -796,7 +796,6 @@ async def update_score(judge_id: str, score_data: ScoreDetailUpdate): ON CONFLICT(judge_id, program_sn) DO UPDATE SET {field_map[score_data.field]} = excluded.{field_map[score_data.field]}, updated_at = excluded.updated_at, - admin_total_score = NULL """, (judge_id, score_data.program_sn, val, datetime.now()), ) @@ -863,20 +862,10 @@ async def batch_update_scores(batch_data: ScoreBatchUpdate): INSERT INTO scores (judge_id, program_sn, admin_total_score, updated_at) VALUES (?, ?, ?, ?) ON CONFLICT(judge_id, program_sn) DO UPDATE SET - content_score = NULL, - stage_score = NULL, - art_score = NULL, - overall_score = NULL, admin_total_score = excluded.admin_total_score, - comment = NULL, updated_at = excluded.updated_at """, - ( - judge_id, - batch_data.program_sn, - total_score, - datetime.now(), - ), + (judge_id, batch_data.program_sn, total_score, datetime.now()), ) return {'success': True} @@ -974,8 +963,8 @@ async def get_aggregate(batch_id: int | None = Query(None)): for row in cursor.fetchall(): stats[row['program_sn']] = { 'avg_score': row['avg_score'] if row['avg_score'] is not None else None, - 'max_score': row['max_score'] or 0, - 'min_score': row['min_score'] or 0, + 'max_score': row['max_score'], + 'min_score': row['min_score'], 'scored_count': row['scored_count'] or 0, } @@ -1194,7 +1183,7 @@ def render_print_program_template(
| 评委姓名 | 总分(100分) | 评委点评 |
|---|---|---|
| {judge['name']} | {s.get('total') if s.get('total', 0) > 0 else '-'} | {s.get('comment', '')} |
| {judge['name']} | {s.get('total') if s.get('total') is not None else '-'} | {s.get('comment', '')} |
评委组签名:____________________
日期:{datetime.now().strftime('%Y年%m月%d日')}