Skip to content

Commit

Permalink
Merge pull request #266 from serfend/JxTrade
Browse files Browse the repository at this point in the history
fix[trade]latest timestamp
  • Loading branch information
Serfend authored Jun 28, 2023
2 parents 06f25ff + 733bf9a commit 9f13f34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/jx3/price_goods/lib/GoodsPrice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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]
Expand Down

0 comments on commit 9f13f34

Please sign in to comment.