From c082b525b5e501dfa24038e3a85e444d88bfb1d0 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 28 四月 2023 19:33:15 +0800
Subject: [PATCH] 开盘啦采集工具/看盘页面优化

---
 code_data_manager.py |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/code_data_manager.py b/code_data_manager.py
index 85f8994..a1e19a8 100644
--- a/code_data_manager.py
+++ b/code_data_manager.py
@@ -38,29 +38,30 @@
         datas = sorted(datas, key=lambda tup: int(tup["created_at"].split(" ")[1].replace(":", "")))
         return datas
 
-    def get_lack_datas_time_range(self, datas):
+    def get_lack_datas_time_range(self, datas, min_time=None):
         def is_trade_time(time_):
             if int("092500") <= int(time_.replace(":", "")) <= int("113000") or int("130000") <= int(
-                    last_time.replace(":", "")) <= int("150000"):
+                    time_.replace(":", "")) <= int("150000"):
                 return True
             return False
 
         ranges = []
-        # 鍙幏鍙�18鍒嗛挓鍐呯殑鏁版嵁
+
         now_time_str = tool.get_now_time_str()
         if tool.trade_time_sub(now_time_str, "15:00:00") > 0:
             now_time_str = "15:00:00"
 
-        if tool.trade_time_sub(now_time_str, "13:00:00") < 0 and tool.trade_time_sub(now_time_str, "11:30:00") > 0 :
+        if tool.trade_time_sub(now_time_str, "13:00:00") < 0 and tool.trade_time_sub(now_time_str, "11:30:00") > 0:
             now_time_str = "11:30:00"
 
         # 杩樻病鍒版椂闂�
         if tool.trade_time_sub(now_time_str, "09:25:00") < 0:
             return ranges
 
-        last_time = tool.trade_time_add_second(now_time_str, 0 - 18 * 60)
-        if tool.trade_time_sub(last_time, "09:25:00") < 0:
-            last_time = "09:25:00"
+        last_time = "09:25:01" if min_time is None else min_time
+        # tool.trade_time_add_second(now_time_str, 0 - 18 * 60)
+        # if tool.trade_time_sub(last_time, "09:25:00") < 0:
+        #    last_time = "09:25:00"
 
         if len(datas) == 0:
             ranges.append((last_time, now_time_str))

--
Gitblit v1.8.0