From b880eff9ee01cf1ed608ef460962ed096de52764 Mon Sep 17 00:00:00 2001 From: pengtao Date: Mon, 20 Dec 2021 11:34:51 +0800 Subject: [PATCH] 1 --- main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index d9eb7b5..ac2771a 100644 --- a/main.py +++ b/main.py @@ -32,11 +32,11 @@ tags_metadata = [ ] orderby_list = { - 1: "pubDate", # 上线时间 + 1: "pubDate", # 上线时间 2: "discountLeftTime", #折扣截止时间 3: "isLowest", # 史低 - 4: "cutOff", # 折扣力度 - 5: "cuttime", # 价格变动时间 + 4: "cutOff", # 折扣力度 + 5: "cuttime", # 价格变动时间 6: "price", # 当前价格 7: "mcScore" # 评分 } @@ -195,8 +195,8 @@ async def getgameprice(request: Request, oldGameId: int, nums: int = 0): else: gameprice = db["gameprice"].find_one({"oldGameId": oldGameId}, {"_id": 0}) - price = gameprice.get('prices', []) - if price: + if gameprice: + price = gameprice.get('prices', []) gameprice['prices'] = price[:nums] else: logger.error(f"get price with {oldGameId} failed\n {gameprice}")