fix: use entityId for QSO stats entity counting to match DXCC award

Changed QSO page statistics to count entities using entity_id (numeric
DXCC code) instead of entity (text field) for consistency with DXCC
award progress calculations.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-01-24 18:33:54 +01:00
parent 70858836d0
commit b296514356

View File

@@ -552,7 +552,7 @@ export async function getQSOStats(userId) {
}).from(qsos).where(eq(qsos.userId, userId)), }).from(qsos).where(eq(qsos.userId, userId)),
db.select({ db.select({
uniqueEntities: sql`CAST(COUNT(DISTINCT entity) AS INTEGER)`, uniqueEntities: sql`CAST(COUNT(DISTINCT entity_id) AS INTEGER)`,
uniqueBands: sql`CAST(COUNT(DISTINCT band) AS INTEGER)`, uniqueBands: sql`CAST(COUNT(DISTINCT band) AS INTEGER)`,
uniqueModes: sql`CAST(COUNT(DISTINCT mode) AS INTEGER)` uniqueModes: sql`CAST(COUNT(DISTINCT mode) AS INTEGER)`
}).from(qsos).where(eq(qsos.userId, userId)) }).from(qsos).where(eq(qsos.userId, userId))