fix: 自动提现不再要求手机号/收款码,仅校验微信OpenID;手动提现保持原校验收款信息
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user