前台得獎照片呈現
This commit is contained in:
@@ -1885,11 +1885,25 @@ export function CompetitionManagement() {
|
||||
}
|
||||
|
||||
// 準備獎項數據
|
||||
console.log('🔍 準備獎項數據 - 參賽者資訊:', {
|
||||
actualParticipantType,
|
||||
participantId: newAward.participantId,
|
||||
participantName,
|
||||
participant: participant ? {
|
||||
id: participant.id,
|
||||
name: participant.name,
|
||||
primary_app_id: participant.primary_app_id,
|
||||
primary_app_name: participant.primary_app_name,
|
||||
app_id: participant.app_id,
|
||||
app_name: participant.app_name
|
||||
} : null
|
||||
});
|
||||
|
||||
const awardData = {
|
||||
competition_id: newAward.competitionId,
|
||||
app_id: actualParticipantType === "individual" ? newAward.participantId : (participant?.app_id || null),
|
||||
app_id: actualParticipantType === "individual" ? newAward.participantId : (participant?.primary_app_id || null),
|
||||
team_id: actualParticipantType === "team" ? newAward.participantId : null,
|
||||
app_name: actualParticipantType === "individual" ? participantName : (participant?.app_name || null),
|
||||
app_name: actualParticipantType === "individual" ? participantName : (participant?.primary_app_name || null),
|
||||
team_name: actualParticipantType === "team" ? participantName : null,
|
||||
creator: creatorName,
|
||||
award_type: newAward.awardType,
|
||||
@@ -1936,9 +1950,9 @@ export function CompetitionManagement() {
|
||||
const awardItem = {
|
||||
id: result.data.id || selectedAward.id,
|
||||
competitionId: newAward.competitionId,
|
||||
appId: actualParticipantType === "individual" ? newAward.participantId : (participant?.app_id || null),
|
||||
appId: actualParticipantType === "individual" ? newAward.participantId : (participant?.primary_app_id || null),
|
||||
teamId: actualParticipantType === "team" ? newAward.participantId : null,
|
||||
appName: actualParticipantType === "individual" ? participantName : (participant?.app_name || null),
|
||||
appName: actualParticipantType === "individual" ? participantName : (participant?.primary_app_name || null),
|
||||
teamName: actualParticipantType === "team" ? participantName : null,
|
||||
creator: creatorName,
|
||||
awardType: newAward.awardType as any,
|
||||
|
@@ -1728,7 +1728,10 @@ export class CompetitionService extends DatabaseServiceBase {
|
||||
u.name as leader_name,
|
||||
u.phone as leader_phone,
|
||||
COUNT(DISTINCT tm.id) as actual_member_count,
|
||||
COUNT(DISTINCT a.id) as app_count
|
||||
COUNT(DISTINCT a.id) as app_count,
|
||||
-- 獲取團隊的主要應用(第一個應用)
|
||||
(SELECT a2.id FROM apps a2 WHERE a2.team_id = t.id AND a2.is_active = 1 ORDER BY a2.created_at ASC LIMIT 1) as primary_app_id,
|
||||
(SELECT a2.name FROM apps a2 WHERE a2.team_id = t.id AND a2.is_active = 1 ORDER BY a2.created_at ASC LIMIT 1) as primary_app_name
|
||||
FROM competition_teams ct
|
||||
JOIN teams t ON ct.team_id = t.id
|
||||
LEFT JOIN users u ON t.leader_id = u.id
|
||||
|
Reference in New Issue
Block a user