From 733bf9a71b3e9db8f83de0651eb1f4aaebd79e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=89=E5=B9=BF?= Date: Wed, 28 Jun 2023 11:26:24 +0800 Subject: [PATCH] fix[trade]latest timestamp --- src/plugins/jx3/price_goods/lib/GoodsPrice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/jx3/price_goods/lib/GoodsPrice.py b/src/plugins/jx3/price_goods/lib/GoodsPrice.py index 8527e277f..26f0a3216 100644 --- a/src/plugins/jx3/price_goods/lib/GoodsPrice.py +++ b/src/plugins/jx3/price_goods/lib/GoodsPrice.py @@ -35,7 +35,7 @@ def __init__(self, prices: list = None) -> None: key = ['created', 'n_count', 'unit_price'] self.prices = [[x.get(k) for k in key] for x in prices] # 创建时间 数量 单价 self.valid_price = self.get_valid_price() - self.latest = None # 最新数据时间 + self.latest = 0 # 最新数据时时间戳 super().__init__() def get_valid_price(self, prices: list = None): @@ -49,7 +49,7 @@ def get_valid_price(self, prices: list = None): self.price_valid = GoodsPriceDetail.InvalidPrice return self.price_valid prices.sort(key=lambda x: x[2]) # 按价格升序排列 - self.latest = max(prices, key=lambda x: x[1]) + self.latest = int(max(prices, key=lambda x: x[1])[0]) * 1e3 total_price = 0 self.price_lowest = prices[0][2]