From b2a2da0f9733c10f7713171732e7bd7b14046a3f Mon Sep 17 00:00:00 2001 From: XingQue Date: Wed, 8 Jul 2026 22:16:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=87=AA=E5=8A=A8=E6=8F=90=E7=8E=B0?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E8=A6=81=E6=B1=82=E6=89=8B=E6=9C=BA=E5=8F=B7?= =?UTF-8?q?/=E6=94=B6=E6=AC=BE=E7=A0=81=EF=BC=8C=E4=BB=85=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E5=BE=AE=E4=BF=A1OpenID=EF=BC=9B=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E6=8F=90=E7=8E=B0=E4=BF=9D=E6=8C=81=E5=8E=9F=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=94=B6=E6=AC=BE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- users/tixian_shenhe_services.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/users/tixian_shenhe_services.py b/users/tixian_shenhe_services.py index 9f977ae..acb7e74 100644 --- a/users/tixian_shenhe_services.py +++ b/users/tixian_shenhe_services.py @@ -242,7 +242,7 @@ def _dashou_has_open_penalties(yonghuid): def validate_payment_info_for_withdraw(user_main): - """申请/收款前:须已绑定手机号,且收款账号与收款码至少一项。""" + """手动提现:须已绑定手机号,且收款账号与收款码至少一项。自动提现不走此函数。""" phone = (getattr(user_main, 'Phone', None) or '').strip() account = (getattr(user_main, 'PaymentAccount', None) or '').strip() qr = (getattr(user_main, 'PaymentQRCode', None) or '').strip() @@ -253,10 +253,21 @@ def validate_payment_info_for_withdraw(user_main): return True, '' +def validate_auto_withdraw_prerequisites(user_main): + """ + 自动提现(zddksh / tixiansq):微信企业付款到用户 OpenID。 + 不要求手机号、收款码、收款账号;须已绑定微信 OpenID。 + """ + openid = (getattr(user_main, 'OpenID', None) or '').strip() + if not openid: + return False, '请先使用微信登录后再申请自动提现' + return True, '' + + def validate_withdraw_eligibility(user_main, leixing, jine): """ - 提现申请资格校验(完整基本条件;仅放宽「不限制并行申请笔数」)。 - 与手动提现 TixianShenqingView 对齐。 + 提现资格校验(打手/管事/押金等业务条件;不校收款码/手机号)。 + 手动提现另在 TixianShenqingView 校验收款信息;自动提现另校 OpenID。 """ yonghuid = user_main.UserUID @@ -383,13 +394,13 @@ def validate_collect_amount(audit): def validate_collect_eligibility(user_main, leixing): """ - 收款前严格校验(申请时已扣款,不再校余额)。 + 自动提现收款前严格校验(申请时已扣款,不再校余额)。 打手佣金/押金:罚单、封禁、接单中、积分、会员、订单等; - 其他身份:账号状态、罚单/订单等。 + 不要求手机号/收款码(微信打款到 OpenID)。 """ - pay_ok, pay_msg = validate_payment_info_for_withdraw(user_main) - if not pay_ok: - return False, pay_msg + wx_ok, wx_msg = validate_auto_withdraw_prerequisites(user_main) + if not wx_ok: + return False, wx_msg yonghuid = user_main.UserUID @@ -1414,9 +1425,9 @@ def create_audit_application(user_main, leixing, jine): """ yonghuid = user_main.UserUID - pay_ok, pay_msg = validate_payment_info_for_withdraw(user_main) - if not pay_ok: - raise ValueError(pay_msg) + wx_ok, wx_msg = validate_auto_withdraw_prerequisites(user_main) + if not wx_ok: + raise ValueError(wx_msg) ok, msg, extra = validate_withdraw_eligibility(user_main, leixing, jine) if not ok: