fix: 假单开启后无对应会员稳定走假池,避免真假交替

This commit is contained in:
XingQue
2026-07-30 20:03:42 +08:00
parent bb74140150
commit c8a3d0274d
3 changed files with 74 additions and 25 deletions

View File

@@ -20,10 +20,15 @@ def is_club_fake_grab_enabled(club_id: str) -> bool:
try:
from jituan.models import Club
club = Club.query.filter(club_id=cid).first()
if not club and cid != cid.lower():
club = Club.query.filter(club_id=cid.lower()).first()
if not club:
return False
cfg = club.config_json or {}
return bool(cfg.get(CONFIG_KEY))
raw = cfg.get(CONFIG_KEY)
if isinstance(raw, str):
return raw.strip().lower() in ('1', 'true', 'yes', 'on')
return bool(raw)
except Exception:
logger.exception('read fake_grab_order_enabled failed club=%s', cid)
return False