1. исправил agent.py
2. поменял явки и пароли для создания операторов 3. убрал из maches.html оператора, и добавил галочку завершенные матчи
This commit is contained in:
@@ -207,3 +207,45 @@ def list_available_tours():
|
||||
return tours
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
def list_matches_for_admin(
|
||||
today_only: bool = False,
|
||||
tour: str | None = None,
|
||||
hide_finished: bool = True,
|
||||
):
|
||||
query = """
|
||||
SELECT
|
||||
m.id,
|
||||
m.external_id,
|
||||
m.match_date,
|
||||
m.status,
|
||||
m.tour,
|
||||
m.season,
|
||||
ht.name AS home_team_name,
|
||||
at.name AS away_team_name
|
||||
FROM matches m
|
||||
JOIN teams ht ON ht.id = m.home_team_id
|
||||
JOIN teams at ON at.id = m.away_team_id
|
||||
WHERE 1=1
|
||||
"""
|
||||
params = []
|
||||
|
||||
if today_only:
|
||||
query += " AND DATE(m.match_date) = CURRENT_DATE "
|
||||
|
||||
if tour:
|
||||
query += " AND m.tour = %s "
|
||||
params.append(tour)
|
||||
|
||||
if hide_finished:
|
||||
query += " AND COALESCE(m.status, 'scheduled') <> 'finished' "
|
||||
|
||||
query += " ORDER BY m.match_date ASC NULLS LAST, m.id ASC; "
|
||||
|
||||
conn = get_connection()
|
||||
try:
|
||||
with conn.cursor() as cur:
|
||||
cur.execute(query, params)
|
||||
return cur.fetchall()
|
||||
finally:
|
||||
conn.close()
|
||||
Reference in New Issue
Block a user