impl rank query method

This commit is contained in:
UncleJim 2024-01-19 18:31:28 +00:00
parent 33644f2d25
commit b202f31938

View File

@ -269,6 +269,7 @@ round_info = Table(
Column("count", Integer), Column("count", Integer),
Column("win", Integer), Column("win", Integer),
Column("points", Integer), Column("points", Integer),
Column("play_dt", TIMESTAMP, server_default=func.now()),
UniqueConstraint("user", "round_id", name="idac_user_round_info_uk"), UniqueConstraint("user", "round_id", name="idac_user_round_info_uk"),
mysql_charset="utf8mb4", mysql_charset="utf8mb4",
) )
@ -831,6 +832,13 @@ class IDACItemData(BaseData):
return None return None
return result.fetchall() return result.fetchall()
def get_round_rank_by_id(self, aime_id: int, round_event_id: int) -> Optional[List[Row]]:
result = self.execute('call query_user_round_ranking(:aime_id, :round_event_id)', {'aime_id': aime_id, 'round_event_id': round_event_id})
if result is None:
return None
return result.fetchone()
def get_timetrial_event( def get_timetrial_event(
self, aime_id: int, timetrial_event_id: int self, aime_id: int, timetrial_event_id: int
) -> Optional[Row]: ) -> Optional[Row]: