feat: 俱乐部组队开关与提现会员/积分门槛分店配置

This commit is contained in:
XingQue committed 2026-08-04 12:47:17 +08:00
1 parent 527e83eeb2
commit 080c55bf2a
7 files changed
+257 -35

No files matched your search

+54 -26
View File
@@ -356,14 +356,21 @@ def validate_withdraw_eligibility(user_main, leixing, jine):
return False, '您不是打手身份,无法提现佣金', {}
if dashou.zhanghaozhuangtai != 1:
return False, '打手账号已被封禁,无法提现', {}
if dashou.jifen < 10:
return False, '积分不足10分,请补充积分后提现', {}
huiyuan_ok, huiyuan_msg = check_dashou_has_formal_huiyuan_for_withdraw(yonghuid)
if not huiyuan_ok:
return False, huiyuan_msg, {}
trial_ok, trial_msg = check_dashou_trial_blocks_commission_withdraw(yonghuid)
if not trial_ok:
return False, trial_msg, {}
from jituan.services.withdraw_eligibility_switch import (
is_withdraw_require_formal_huiyuan,
is_withdraw_require_jifen,
JIFEN_MIN,
)
club_id = club_id_for_tixian_yonghuid(yonghuid)
if is_withdraw_require_jifen(club_id) and dashou.jifen < JIFEN_MIN:
return False, f'积分不足{JIFEN_MIN}分,请补充积分后提现', {}
if is_withdraw_require_formal_huiyuan(club_id):
huiyuan_ok, huiyuan_msg = check_dashou_has_formal_huiyuan_for_withdraw(yonghuid)
if not huiyuan_ok:
return False, huiyuan_msg, {}
trial_ok, trial_msg = check_dashou_trial_blocks_commission_withdraw(yonghuid)
if not trial_ok:
return False, trial_msg, {}
if _dashou_has_orders_blocking_withdraw_apply(yonghuid):
return False, '您还有未完成或未退款的订单,请先处理完毕再提现', {}
if _dashou_has_open_penalties(yonghuid):
@@ -412,11 +419,18 @@ def validate_withdraw_eligibility(user_main, leixing, jine):
return False, '您不是打手身份,无法提取押金', {}
if dashou.zhanghaozhuangtai != 1:
return False, '打手账号已禁用,无法提取押金', {}
if dashou.jifen < 10:
return False, '积分不足10分,请补充积分后提取押金', {}
huiyuan_ok, huiyuan_msg = check_dashou_has_formal_huiyuan_for_withdraw(yonghuid)
if not huiyuan_ok:
return False, huiyuan_msg, {}
from jituan.services.withdraw_eligibility_switch import (
is_withdraw_require_formal_huiyuan,
is_withdraw_require_jifen,
JIFEN_MIN,
)
club_id = club_id_for_tixian_yonghuid(yonghuid)
if is_withdraw_require_jifen(club_id) and dashou.jifen < JIFEN_MIN:
return False, f'积分不足{JIFEN_MIN}分,请补充积分后提取押金', {}
if is_withdraw_require_formal_huiyuan(club_id):
huiyuan_ok, huiyuan_msg = check_dashou_has_formal_huiyuan_for_withdraw(yonghuid)
if not huiyuan_ok:
return False, huiyuan_msg, {}
if dashou.yajin < jine:
return False, f'押金余额不足,当前押金: {dashou.yajin}', {}
if _dashou_has_orders_blocking_withdraw_apply(yonghuid):
@@ -488,14 +502,21 @@ def validate_collect_eligibility(user_main, leixing):
return False, '打手账号已被封禁,无法收款'
if dashou.zhuangtai != 1:
return False, '您有订单进行中,请完成后再收款'
if dashou.jifen < 10:
return False, '积分不足10分,无法收款'
huiyuan_ok, huiyuan_msg = check_dashou_has_formal_huiyuan_for_withdraw(yonghuid)
if not huiyuan_ok:
return False, huiyuan_msg
trial_ok, trial_msg = check_dashou_trial_blocks_commission_withdraw(yonghuid)
if not trial_ok:
return False, trial_msg
from jituan.services.withdraw_eligibility_switch import (
is_withdraw_require_formal_huiyuan,
is_withdraw_require_jifen,
JIFEN_MIN,
)
club_id = club_id_for_tixian_yonghuid(yonghuid)
if is_withdraw_require_jifen(club_id) and dashou.jifen < JIFEN_MIN:
return False, f'积分不足{JIFEN_MIN}分,无法收款'
if is_withdraw_require_formal_huiyuan(club_id):
huiyuan_ok, huiyuan_msg = check_dashou_has_formal_huiyuan_for_withdraw(yonghuid)
if not huiyuan_ok:
return False, huiyuan_msg
trial_ok, trial_msg = check_dashou_trial_blocks_commission_withdraw(yonghuid)
if not trial_ok:
return False, trial_msg
if _dashou_has_orders_blocking_withdraw_apply(yonghuid):
return False, '您还有进行中的订单,请完成后再收款'
if _dashou_has_open_penalties(yonghuid):
@@ -511,11 +532,18 @@ def validate_collect_eligibility(user_main, leixing):
return False, '打手账号已禁用,无法收款'
if dashou.zhuangtai != 1:
return False, '您有订单进行中,请完成后再收款'
if dashou.jifen < 10:
return False, '积分不足10分,无法收款'
huiyuan_ok, huiyuan_msg = check_dashou_has_formal_huiyuan_for_withdraw(yonghuid)
if not huiyuan_ok:
return False, huiyuan_msg
from jituan.services.withdraw_eligibility_switch import (
is_withdraw_require_formal_huiyuan,
is_withdraw_require_jifen,
JIFEN_MIN,
)
club_id = club_id_for_tixian_yonghuid(yonghuid)
if is_withdraw_require_jifen(club_id) and dashou.jifen < JIFEN_MIN:
return False, f'积分不足{JIFEN_MIN}分,无法收款'
if is_withdraw_require_formal_huiyuan(club_id):
huiyuan_ok, huiyuan_msg = check_dashou_has_formal_huiyuan_for_withdraw(yonghuid)
if not huiyuan_ok:
return False, huiyuan_msg
if _dashou_has_orders_blocking_withdraw_apply(yonghuid):
return False, '您还有进行中的订单,请完成后再收款'
if _dashou_has_open_penalties(yonghuid):
+17 -9
View File
@@ -515,7 +515,7 @@ class TixianShenqingView(APIView):
# ==================== 校验函数 ====================
def _check_dashou_commission_withdraw(self, user_main, jine):
"""打手佣金提现校验"""
"""打手佣金提现校验(遗留辅助;主路径用 validate_withdraw_eligibility)"""
try:
dashou = UserDashou.query.get(user=user_main)
except ObjectDoesNotExist:
@@ -525,18 +525,26 @@ class TixianShenqingView(APIView):
return {'code': 11, 'msg': '打手账号已被封禁,无法提现'}
if dashou.zhuangtai != 1:
return {'code': 12, 'msg': '您有订单进行中,请完成后提现'}
if dashou.jifen < 10:
return {'code': 15, 'msg': '积分不足10分,请补充积分后提现'}
from jituan.services.wechat_pay import club_id_for_tixian_yonghuid
from jituan.services.withdraw_eligibility_switch import (
is_withdraw_require_formal_huiyuan,
is_withdraw_require_jifen,
JIFEN_MIN,
)
club_id = club_id_for_tixian_yonghuid(user_main.UserUID)
if is_withdraw_require_jifen(club_id) and dashou.jifen < JIFEN_MIN:
return {'code': 15, 'msg': f'积分不足{JIFEN_MIN}分,请补充积分后提现'}
if dashou.yue < jine:
return {'code': 13, 'msg': f'余额不足,当前余额: {dashou.yue}'}
formal_ok, formal_msg = check_dashou_has_formal_huiyuan_for_withdraw(user_main.UserUID)
if not formal_ok:
return {'code': 14, 'msg': formal_msg}
if is_withdraw_require_formal_huiyuan(club_id):
formal_ok, formal_msg = check_dashou_has_formal_huiyuan_for_withdraw(user_main.UserUID)
if not formal_ok:
return {'code': 14, 'msg': formal_msg}
trial_ok, trial_msg = check_dashou_trial_blocks_commission_withdraw(user_main.UserUID)
if not trial_ok:
return {'code': 16, 'msg': trial_msg}
trial_ok, trial_msg = check_dashou_trial_blocks_commission_withdraw(user_main.UserUID)
if not trial_ok:
return {'code': 16, 'msg': trial_msg}
return {'code': 0, 'msg': 'ok', 'data': {'nicheng': dashou.nicheng or ''}}