From 6a107545a82cceaff58b769690f410f25ef4de34 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期二, 07 十一月 2023 15:55:53 +0800
Subject: [PATCH] Bug修复

---
 third_data/kpl_block_util.py |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/third_data/kpl_block_util.py b/third_data/kpl_block_util.py
index 2bb6b1c..29fce8e 100644
--- a/third_data/kpl_block_util.py
+++ b/third_data/kpl_block_util.py
@@ -155,7 +155,7 @@
 # 鑾峰彇褰撴棩瀹炴椂韬綅
 # before_blocks_dict鏍煎紡浣峽"浠g爜":set("鏉垮潡")}
 def get_code_current_rank(code, block, current_limit_up_datas, code_limit_up_reason_dict,
-                          yesterday_current_limit_up_codes, exclude_codes, shsz=False):
+                          yesterday_current_limit_up_codes, exclude_codes,open_limit_up_count, shsz=False):
     block_codes_infos = []
     limit_up_time = time.time()
     for k in current_limit_up_datas:
@@ -168,15 +168,20 @@
         if k[0] in yesterday_current_limit_up_codes:
             continue
         if code_limit_up_reason_dict.get(k[0]) == block:
-            if k[0] != code and k[0] not in exclude_codes:
+            if k[0] != code:
                 # 浠g爜.娑ㄥ仠鏃堕棿
                 block_codes_infos.append((k[0], int(k[2])))
     block_codes_infos.append((code, limit_up_time))
     block_codes_infos.sort(key=lambda x: x[1])
     front_codes = []
+    first_count = 0
     for i in range(0, len(block_codes_infos)):
+        if i == open_limit_up_count and exclude_codes and block_codes_infos[i][0] in exclude_codes:
+            # 闈炲紑1鑰佸ぇ琚帓闄�
+            first_count += 1
+            continue
         if block_codes_infos[i][0] == code:
-            return i, front_codes
+            return i - first_count, front_codes
         else:
             front_codes.append(block_codes_infos[i][0])
     return 0, []

--
Gitblit v1.8.0