修复了客服日统计时机,展示更加全面的数据

This commit is contained in:
XingQue
2026-06-20 04:23:31 +08:00
parent 993c0c54b0
commit c70b2ee7be
10 changed files with 83 additions and 48 deletions

View File

@@ -17,8 +17,7 @@ from merchant_ops.services.order_query import (
from merchant_ops.services.order_enrich import staff_order_list_item
from merchant_ops.services.audit import audit_staff
from merchant_ops.services.dispatch import staff_dispatch_order
from merchant_ops.services.stats import bump_cancel_count, bump_penalty_count, update_merchant_and_staff_stats
from merchant_ops.constants import STAT_ACTION_REFUND, STAT_ACTION_SETTLE
from merchant_ops.services.stats import bump_cancel_count, bump_penalty_count
from orders.models import MerchantOrderExt
from orders.views import (
ShangjiaDingdanXiangqingView, ShangjiaJiesuanView, ShangjiaChexiaoView,
@@ -155,11 +154,6 @@ class StaffSettleView(APIView):
resp = proxy_merchant_order_view(request, member, ShangjiaJiesuanView, 'order_settle')
if resp.data.get('code') in (0, 200):
audit_staff(member, 'SETTLE', request, resource_id=pick_order_id(request.data))
from orders.models import Order
oid = pick_order_id(request.data)
o = Order.query.filter(OrderID=oid).first()
if o:
update_merchant_and_staff_stats(member.merchant_id, member, o.Amount, STAT_ACTION_SETTLE)
return resp
except Exception as e:
return _err(e)
@@ -189,11 +183,6 @@ class StaffRefundView(APIView):
resp = proxy_merchant_order_view(request, member, ShangjiaTuikuanShenqingView, 'order_refund_apply')
if resp.data.get('code') in (0, 200):
audit_staff(member, 'REFUND_APPLY', request, resource_id=pick_order_id(request.data))
from orders.models import Order
oid = pick_order_id(request.data)
o = Order.query.filter(OrderID=oid).first()
if o:
update_merchant_and_staff_stats(member.merchant_id, member, o.Amount, STAT_ACTION_REFUND)
return resp
except Exception as e:
return _err(e)