From 9c9b93d9c7075b735b7904180a6e454b9aa7560f Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期四, 23 五月 2024 18:38:01 +0800 Subject: [PATCH] bug修复 --- utils/tool.py | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/utils/tool.py b/utils/tool.py index 0b39e4f..d085f3d 100644 --- a/utils/tool.py +++ b/utils/tool.py @@ -254,3 +254,25 @@ except: pass return None + + +# 娣辫瘉 +MARKET_TYPE_SZSE = 1 +# 涓婅瘉 +MARKET_TYPE_SSE = 0 +# 鏈煡 +MARKET_TYPE_UNKNOWN = -1 + + +def get_market_type(code): + """ + 鏍规嵁鑲$エ浠g爜 + :param code: + :return: + """ + if code.find("00") == 0 or code.find("30") == 0 or code.find("12") == 0: + return MARKET_TYPE_SZSE + elif code.find("60") == 0 or code.find("68") == 0 or code.find("11") == 0: + return MARKET_TYPE_SSE + else: + return MARKET_TYPE_UNKNOWN -- Gitblit v1.8.0