все остальные апдейты на Кубок России

This commit is contained in:
2026-07-02 17:00:15 +03:00
parent 03a68ee8ca
commit e7b215af5e
11 changed files with 1644 additions and 180 deletions

View File

@@ -355,7 +355,7 @@ def get_tour_schedule_by_match_id(match_id: int) -> list[dict]:
with conn.cursor() as cur:
cur.execute(
"""
SELECT m.tour, m.season, m.source_key
SELECT m.tour
FROM matches m
WHERE m.id = %s
""",
@@ -366,8 +366,6 @@ def get_tour_schedule_by_match_id(match_id: int) -> list[dict]:
return []
tour = row[0]
season = row[1]
source_key = resolve_match_source_key(match_id, row[2] if len(row) > 2 else None)
cur.execute(
"""
@@ -386,13 +384,11 @@ def get_tour_schedule_by_match_id(match_id: int) -> list[dict]:
LEFT JOIN teams ht ON ht.id = m.home_team_id
LEFT JOIN teams at ON at.id = m.away_team_id
WHERE m.tour = %s
AND (%s IS NULL OR m.season = %s)
AND COALESCE(NULLIF(m.source_key, ''), %s) = %s
ORDER BY
m.match_date NULLS LAST,
m.id
""",
(tour, season, season, source_key, source_key),
(tour,),
)
rows = cur.fetchall()