fix: 超管强制结单跳过客服统计,避免 kefu 为 None 整单回滚
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1903,11 +1903,12 @@ class KefuForceCompleteView(APIView):
|
|||||||
if order.Platform == 2:
|
if order.Platform == 2:
|
||||||
settle_shangjia_order_guanshi_fenhong(order, dashou_id)
|
settle_shangjia_order_guanshi_fenhong(order, dashou_id)
|
||||||
|
|
||||||
# 8. 更新客服统计
|
# 8. 更新客服统计(超管/管理员无 KefuProfile 时跳过,不影响结单)
|
||||||
kefu.jinrichuli = F('jinrichuli') + 1
|
if kefu is not None:
|
||||||
kefu.jinyuechuli = F('jinyuechuli') + 1
|
kefu.jinrichuli = F('jinrichuli') + 1
|
||||||
kefu.zongchuli = F('zongchuli') + 1
|
kefu.jinyuechuli = F('jinyuechuli') + 1
|
||||||
kefu.save(update_fields=['jinrichuli', 'jinyuechuli', 'zongchuli'])
|
kefu.zongchuli = F('zongchuli') + 1
|
||||||
|
kefu.save(update_fields=['jinrichuli', 'jinyuechuli', 'zongchuli'])
|
||||||
|
|
||||||
return Response({'code': 0, 'msg': '强制结单成功'})
|
return Response({'code': 0, 'msg': '强制结单成功'})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user