更新统计人数

codex/dev
AlanPaine 2026-04-01 09:41:35 +00:00
parent 181f4565b4
commit a3ae293d42
1 changed files with 11 additions and 1 deletions

View File

@ -1175,6 +1175,16 @@ def get_meeting_preview_data(meeting_id: int, password: Optional[str] = None):
cursor.execute(attendees_query, (meeting_id,))
attendees_data = cursor.fetchall()
attendees = [{'user_id': row['user_id'], 'caption': row['caption']} for row in attendees_data]
cursor.execute(
'''
SELECT COUNT(DISTINCT speaker_id) AS participant_count
FROM transcript_segments
WHERE meeting_id = %s AND speaker_id IS NOT NULL
''',
(meeting_id,)
)
speaker_count_row = cursor.fetchone() or {}
participant_count = speaker_count_row.get('participant_count') or len(attendees)
tags = _process_tags(cursor, meeting.get('tags'))
# 组装返回数据
@ -1187,7 +1197,7 @@ def get_meeting_preview_data(meeting_id: int, password: Optional[str] = None):
"prompt_id": meeting['prompt_id'],
"prompt_name": meeting['prompt_name'],
"attendees": attendees,
"attendees_count": len(attendees),
"attendees_count": participant_count,
"tags": tags,
"has_password": bool(meeting.get('access_password')),
"processing_status": progress_info # 附带进度信息供调试