fix: 待收款驳回按业务单号查打款记录,避免 pk 误查导致 400

This commit is contained in:
XingQue
2026-07-30 19:06:38 +08:00
parent 9df450b278
commit 6f4e458871
2 changed files with 60 additions and 33 deletions

View File

@@ -728,7 +728,10 @@ class KefuWithdrawActionView(APIView):
# action=2审核中/待收款 → 驳回
if action == 2:
if cur not in (1, 6) or int(audit.zhuangtai) not in (1, 6):
raise ValueError(f'提现记录{tixian_id}:仅审核中/待收款可驳回')
raise ValueError(
f'提现记录{tixian_id}:仅审核中/待收款可驳回'
f'(当前提现单={cur},审核单={audit.zhuangtai})'
)
admin_reject_pending_or_auditing(
audit, tixian, user, kefu_uid, reason,
refund_principal=refund_principal,
@@ -902,6 +905,7 @@ class KefuWithdrawActionView(APIView):
)
except ValueError as e:
logger.warning('kefu_txsh_action 业务拒绝: %s data=%s', e, request.data)
return Response({'code': 400, 'msg': str(e)}, status=status.HTTP_400_BAD_REQUEST)
except Exception as e:
logger.error(f'处理提现事务失败: {e}', exc_info=True)