Skip to content

Commit d9fecbe

Browse files
committed
feat: 新增两个小茅好运专场预约脚本,支持 2 月 28 日和 1、3-12 月 29 日的专场预约
1 parent 2c90ca1 commit d9fecbe

3 files changed

Lines changed: 1056 additions & 3 deletions

File tree

6_weekend_reservation.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,10 @@ def get_shop_id_by_mode(lat, lng, shop_mode, province_name, city_name,
474474
debug_log(f"--- 🏁 --- 店铺信息: {shop_city_copy}")
475475
break
476476

477+
# 返回店铺ID,如果 filter_shops 为空,则返回异常
478+
if 0 == len(filter_shops):
479+
raise Exception("--- 🚫 没有找到可以预约的店铺")
480+
477481
# 根据 SHOP_MODE 是 NEAREST 或 INVENTORY,获取店铺ID
478482
if shop_mode == "NEAREST":
479483
debug_log("--- 🏁 店铺缺货模式:NEAREST(距离最近)")
@@ -501,9 +505,6 @@ def get_shop_id_by_mode(lat, lng, shop_mode, province_name, city_name,
501505
f"--- 🏁 找到库存最多的店铺:{filter_shops[0].get('name')}, 店铺ID:{filter_shops[0].get('shopId')},库存:{filter_shops[0].get('inventory')}"
502506
)
503507

504-
# 返回店铺ID,如果 filter_shops 为空,则返回异常
505-
if len(filter_shops) == 0:
506-
raise Exception("--- 🚫 没有找到可以预约的店铺")
507508
return filter_shops[0]["shopId"]
508509

509510

0 commit comments

Comments
 (0)