From 178d119f552136d7e119ddab50a01e7f5d642186 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期四, 22 八月 2024 23:38:40 +0800 Subject: [PATCH] 绿名单 /股票板块修改 --- third_data/kpl_data_manager.py | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/third_data/kpl_data_manager.py b/third_data/kpl_data_manager.py index 9130b94..5d640f3 100644 --- a/third_data/kpl_data_manager.py +++ b/third_data/kpl_data_manager.py @@ -241,6 +241,22 @@ return results @classmethod + def get_latest_block_infos(cls, min_day=tool.date_sub(tool.get_now_date_str(), 180), code=None): + """ + + @param min_day: 榛樿鑾峰彇180澶╀箣鍓嶇殑 + @param code: 浠g爜 + @return: 鏈�杩戠殑娑ㄥ仠鏉垮潡淇℃伅 + """ + sql = f"SELECT r.`_code`, r.`_day`, r.`_hot_block_name`, r.`_blocks` FROM `kpl_limit_up_record` r WHERE r.`_day`>'{min_day}'" + if code: + sql += f" AND _code='{code}'" + sql += " order by _create_time" + mysqldb = mysql_data.Mysqldb() + results = mysqldb.select_all(sql) + return results + + @classmethod def get_latest_blocks_set(cls, code): results = cls.get_latest_infos(code, 2, False) bs = set([b[0] for b in results]) -- Gitblit v1.8.0