Merge pull request '[BUGFIX] Fixed Chusan Map Overload' (#175) from EmmyHeart/artemis:develop into develop

Reviewed-on: #175
This commit is contained in:
Hay1tsme 2024-09-14 04:34:44 +00:00
commit 6f6a300879
2 changed files with 4 additions and 3 deletions

View File

@ -104,7 +104,8 @@ class ChuniNew(ChuniBase):
return {"returnCode": "1"} return {"returnCode": "1"}
async def handle_get_user_map_area_api_request(self, data: Dict) -> Dict: async def handle_get_user_map_area_api_request(self, data: Dict) -> Dict:
user_map_areas = await self.data.item.get_map_areas(data["userId"]) map_area_ids = [int(area["mapAreaId"]) for area in data["mapAreaIdList"]]
user_map_areas = await self.data.item.get_map_areas(data["userId"], map_area_ids)
map_areas = [] map_areas = []
for map_area in user_map_areas: for map_area in user_map_areas:

View File

@ -533,8 +533,8 @@ class ChuniItemData(BaseData):
return None return None
return result.lastrowid return result.lastrowid
async def get_map_areas(self, user_id: int) -> Optional[List[Row]]: async def get_map_areas(self, user_id: int, map_area_ids: List[int]) -> Optional[List[Row]]:
sql = select(map_area).where(map_area.c.user == user_id) sql = select(map_area).where(map_area.c.user == user_id, map_area.c.mapAreaId.in_(map_area_ids))
result = await self.execute(sql) result = await self.execute(sql)
if result is None: if result is None: