chuni: fix GetUserNetBattleRankingInfoApi

This commit is contained in:
zaphkito 2024-06-23 16:17:46 +08:00
parent 699337c419
commit acac12c211

View File

@ -793,9 +793,9 @@ class ChuniProfileData(BaseData):
versions = [row[0] for row in versions_raw]
return sorted(versions, reverse=True)
async def put_net_battle(self, user_id: int, net_battle_data: Dict) -> Optional[int]:
async def put_net_battle(self, aime_id: int, net_battle_data: Dict) -> Optional[int]:
sql = insert(net_battle).values(
user=user_id,
user=aime_id,
isRankUpChallengeFailed=net_battle_data['isRankUpChallengeFailed'],
highestBattleRankId=net_battle_data['highestBattleRankId'],
battleIconId=net_battle_data['battleIconId'],
@ -816,7 +816,7 @@ class ChuniProfileData(BaseData):
return result.inserted_primary_key['id']
self.logger.error(f"Failed to put net battle data for user {user_id}")
async def get_net_battle(self, user_id: int) -> Optional[Row]:
result = await self.execute(net_battle.select(net_battle.c.user == user_id))
async def get_net_battle(self, aime_id: int) -> Optional[Row]:
result = await self.execute(net_battle.select(net_battle.c.user == aime_id))
if result:
return result.fetchone()