mirror of
https://github.com/norohind/SquadsActivityMonitor.git
synced 2025-05-30 15:19:15 +03:00
fix leaderboard by action_id
This commit is contained in:
parent
b3449c7c63
commit
d1ec8b2b69
@ -178,7 +178,7 @@ class PostgresModel(AbstractModel):
|
||||
|
||||
with self.db.cursor(cursor_factory=psycopg2.extras.RealDictCursor) as cursor:
|
||||
cursor.execute(
|
||||
postgres_sql_requests.select_last_action_id,
|
||||
postgres_sql_requests.select_leaderboard_by_action_id,
|
||||
{
|
||||
'action_id': action_id
|
||||
}
|
||||
|
@ -97,7 +97,14 @@ limit 1000;
|
||||
"""
|
||||
|
||||
select_leaderboard_by_action_id = """select
|
||||
*
|
||||
name,
|
||||
tag,
|
||||
rank,
|
||||
score,
|
||||
to_char(timestamp, 'YYYY-MM-DD HH24:MI:SS') as timestamp,
|
||||
leaderboard_type,
|
||||
platform,
|
||||
squadron_id
|
||||
from squads_stats_states
|
||||
where action_id = %(action_id)s
|
||||
order by score desc;
|
||||
|
4
web.py
4
web.py
@ -126,7 +126,7 @@ class SumLeaderboardHistoryHtml:
|
||||
class LeaderboardByActionID:
|
||||
def on_get(self, req: falcon.request.Request, resp: falcon.response.Response, action_id: int) -> None:
|
||||
resp.content_type = falcon.MEDIA_JSON
|
||||
resp.text = json.dumps(model.get_diff_action_id(action_id))
|
||||
resp.text = json.dumps(model.get_leaderboard_by_action_id(action_id))
|
||||
|
||||
|
||||
class LeaderboardByActionIDHTML:
|
||||
@ -136,7 +136,7 @@ class LeaderboardByActionIDHTML:
|
||||
'table_template.html',
|
||||
{
|
||||
'target_column_name': 'Tag',
|
||||
'target_new_url': '/squads/now/by-tag/short/'
|
||||
'target_new_url': '/api/leaderboard-state/by-action-id/'
|
||||
}
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user