fix: 自动提现按俱乐部解析微信openid,修复已登录仍提示微信登录

This commit is contained in:
XingQue
2026-07-09 01:06:08 +08:00
parent b2a2da0f97
commit d5fbc08364
3 changed files with 28 additions and 9 deletions

View File

@@ -253,13 +253,19 @@ def validate_payment_info_for_withdraw(user_main):
return True, ''
def get_auto_withdraw_openid(user_main):
"""自动提现打款用 openid兼容 user_wx_openid / User.OpenID / UserName(openid)。"""
from jituan.services.club_user import get_wx_openid_for_user
club_id = club_id_for_tixian_yonghuid(user_main.UserUID)
return (get_wx_openid_for_user(user_main, club_id) or '').strip()
def validate_auto_withdraw_prerequisites(user_main):
"""
自动提现zddksh / tixiansq微信企业付款到用户 OpenID。
不要求手机号、收款码、收款账号;须已绑定微信 OpenID。
不要求手机号、收款码、收款账号;须能解析到微信 OpenID。
"""
openid = (getattr(user_main, 'OpenID', None) or '').strip()
if not openid:
if not get_auto_withdraw_openid(user_main):
return False, '请先使用微信登录后再申请自动提现'
return True, ''