This commit is contained in:
pengtao 2021-12-20 11:39:47 +08:00
parent 3a8712b357
commit b80ee7f433

View File

@ -193,14 +193,13 @@ async def getgameprice(request: Request, oldGameId: int, nums: int = 0):
gameprice = db["gameprice"].find_one({"oldGameId": oldGameId},
{"_id": 0})
else:
gameprice = db["gameprice"].find_one({"oldGameId": oldGameId},
{"_id": 0})
gameprice = db["gameprice"].find({"oldGameId": oldGameId}, {"_id": 0})
if gameprice:
price = gameprice.get('prices', [])
gameprice['prices'] = price[:nums]
else:
logger.error(f"get price with {oldGameId} failed\n {gameprice}")
gameprice = []
gameprice = {}
logger.info(f"get gameprice with {oldGameId} !")
return JSONResponse(
@ -217,7 +216,7 @@ async def getgameinfoext(request: Request, oldGameId: int):
if not gameinfoext:
return JSONResponse(
status_code=starlette.status.HTTP_200_OK,
content="",
content={},
)
dlc_data = gameinfoext.get('dlcList')
new_data = list()