From de7486527817618fa3bf07d0bd50a4bb18f58f4a Mon Sep 17 00:00:00 2001 From: XingQue Date: Sun, 19 Jul 2026 21:34:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=89=93=E6=89=8B=E6=8F=90=E7=8E=B0/?= =?UTF-8?q?=E6=94=B6=E6=AC=BE=E8=AE=A4=E8=B5=A0=E9=80=81=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E4=B8=BA=E6=9C=89=E6=95=88=E4=BC=9A=E5=91=98=E8=B5=84=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- jituan/services/gift_huiyuan.py | 11 +++++++++++ users/tixian_shenhe_services.py | 7 +++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/jituan/services/gift_huiyuan.py b/jituan/services/gift_huiyuan.py index 3f7f07e..81206b1 100644 --- a/jituan/services/gift_huiyuan.py +++ b/jituan/services/gift_huiyuan.py @@ -27,6 +27,17 @@ def _gift_record_active(record, now=None): return daoqi > now +def user_has_any_active_gift_huiyuan(yonghu_id): + """是否持有任意一条未过期的赠送会员(提现/收款资格用)。""" + if not yonghu_id: + return False + now = timezone.now() + for rec in DashouZengsongHuiyuan.query.filter(yonghu_id=yonghu_id): + if _gift_record_active(rec, now=now): + return True + return False + + def parse_gift_daoqi_time(raw): """ 解析到期时间。 diff --git a/users/tixian_shenhe_services.py b/users/tixian_shenhe_services.py index bdde411..dcb66dc 100644 --- a/users/tixian_shenhe_services.py +++ b/users/tixian_shenhe_services.py @@ -240,16 +240,19 @@ def check_dashou_has_valid_huiyuan(yonghuid): def check_dashou_has_formal_huiyuan_for_withdraw(yonghuid): """ - 打手佣金提现/收款:必须持有未过期的正式会员。 - 体验会员期内一律拒绝;体验到期后须购买正式会员。 + 打手佣金提现/收款:须持有未过期的正式会员,或后台赠送会员。 + 体验会员期内一律拒绝;体验到期后须购买正式会员或持有赠送会员。 """ from jituan.services.member_recharge import ( dashou_has_active_formal_huiyuan, dashou_in_active_trial_period, ) + from jituan.services.gift_huiyuan import user_has_any_active_gift_huiyuan if dashou_has_active_formal_huiyuan(yonghuid): return True, '' + if user_has_any_active_gift_huiyuan(yonghuid): + return True, '' if dashou_in_active_trial_period(yonghuid): return False, '体验会员不可提现佣金,请购买正式会员' if not Huiyuangoumai.query.filter(yonghu_id=yonghuid).exists():