商家罚款增加平台审核:新增状态5、证据图、审核API;审核通过前不影响抢单,提现仍拦截未结案罚单
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# utils/fadan_utils.py
|
||||
from orders.models import Penalty
|
||||
from utils.penalty_status import (
|
||||
PENALTY_GRAB_BLOCK_STATUSES,
|
||||
PENALTY_WITHDRAW_BLOCK_STATUSES,
|
||||
)
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger('xiaochengxu')
|
||||
@@ -19,11 +23,11 @@ def check_fadan_qiangdan_eligible(yonghuid: str, action_type: int) -> tuple:
|
||||
"""
|
||||
try:
|
||||
if action_type == 1:
|
||||
# 抢单:仅当存在“影响抢单”且“未解决”的罚单时拦截(待缴纳或申诉中)
|
||||
# 抢单:仅「影响抢单」且「平台审核通过后仍未结案」的罚单拦截
|
||||
blocked = Penalty.objects.filter(
|
||||
PenalizedUserID=yonghuid,
|
||||
AffectsGrabbing=1,
|
||||
Status__in=[1, 3] # 1=待缴纳, 3=申诉中
|
||||
Status__in=PENALTY_GRAB_BLOCK_STATUSES,
|
||||
).exists()
|
||||
if blocked:
|
||||
logger.info(f"用户 {yonghuid} 抢单被拦截:存在未解决的影响抢单罚单")
|
||||
@@ -31,10 +35,10 @@ def check_fadan_qiangdan_eligible(yonghuid: str, action_type: int) -> tuple:
|
||||
return (True, "无罚单限制")
|
||||
|
||||
elif action_type == 2:
|
||||
# 提现:只要存在任意未解决的罚单(待缴纳/申诉中),不论是否影响抢单,一律禁止提现
|
||||
# 提现:平台审核中 / 待缴纳 / 申诉中 均禁止提现
|
||||
blocked = Penalty.objects.filter(
|
||||
PenalizedUserID=yonghuid,
|
||||
Status__in=[1, 3] # 1=待缴纳, 3=申诉中
|
||||
Status__in=PENALTY_WITHDRAW_BLOCK_STATUSES,
|
||||
).exists()
|
||||
if blocked:
|
||||
logger.info(f"用户 {yonghuid} 提现被拦截:存在未解决的罚单")
|
||||
|
||||
Reference in New Issue
Block a user