fix: 提现申请放行退款审核中订单,管理员拒绝退款不再500

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-11 00:06:42 +08:00
parent dc6ddee0d7
commit b02b2dffed
2 changed files with 19 additions and 15 deletions

View File

@@ -69,6 +69,7 @@ ORDER_STATUS_REFUNDED = 5
DASHOU_WITHDRAW_APPLY_NON_BLOCKING_ORDER_STATUSES = (
1, # 待抢单
3, # 已完成
4, # 退款审核中
5, # 已退款
6, # 退款失败
7, # 指定中
@@ -285,7 +286,7 @@ def _dashou_has_unfinished_orders(yonghuid):
def _dashou_has_orders_blocking_withdraw_apply(yonghuid):
"""打手提现申请专用:仅拦进行中(2)、退款审核中(4)等与该用户关联的订单。"""
"""打手提现申请专用:仅拦进行中(2)等与该用户关联的订单。"""
return Order.query.filter(
PlayerID=yonghuid,
).exclude(

View File

@@ -822,11 +822,12 @@ class KefuPlatformRefundView(APIView):
except Exception as e:
logger.error(f"平台退款更新退款记录异常: {str(e)}", exc_info=True)
# 11. 更新客服统计数据
kefu.jinrichuli += 1
kefu.jinyuechuli += 1
kefu.zongchuli += 1
kefu.save()
# 11. 更新客服统计数据(管理员无客服扩展表,跳过)
if kefu is not None:
kefu.jinrichuli += 1
kefu.jinyuechuli += 1
kefu.zongchuli += 1
kefu.save()
# 🔥 新增:调用打手每日统计(成交)
try:
@@ -1082,11 +1083,12 @@ class KefuRejectRefundView(APIView):
logger.error(f"打手每日统计更新失败: {e}")
# 不影响主流程
# 10. 更新客服统计数据
kefu.jinrichuli += 1
kefu.jinyuechuli += 1
kefu.zongchuli += 1
kefu.save()
# 10. 更新客服统计数据(管理员无客服扩展表,跳过)
if kefu is not None:
kefu.jinrichuli += 1
kefu.jinyuechuli += 1
kefu.zongchuli += 1
kefu.save()
return Response({'code': 0, 'msg': '拒绝退款成功'})
@@ -1352,10 +1354,11 @@ class KefuRejectSettlementView(APIView):
kefu.jinrichuli += 1
kefu.jinyuechuli += 1
kefu.zongchuli += 1
kefu.save()
if kefu is not None:
kefu.jinrichuli += 1
kefu.jinyuechuli += 1
kefu.zongchuli += 1
kefu.save()
return Response({'code': 0, 'msg': '拒绝结算成功'})