修复了客服日统计时机,展示更加全面的数据
This commit is contained in:
@@ -198,7 +198,7 @@ def update_dashou_daily_by_action(yonghuid, amount, action):
|
||||
PlayerDailyStats.query.filter(id=stat.id).update(**update_fields)
|
||||
|
||||
|
||||
def update_shangjia_daily(yonghuid, amount, action):
|
||||
def update_shangjia_daily(yonghuid, amount, action, order_id=None):
|
||||
"""
|
||||
根据操作行为更新商家每日统计(派发、结算、退款)
|
||||
|
||||
@@ -206,6 +206,7 @@ def update_shangjia_daily(yonghuid, amount, action):
|
||||
yonghuid: 商家用户ID
|
||||
amount: 当前订单涉及的金额(Decimal)
|
||||
action: 操作类型,1 = 派发,2 = 结算(成交),3 = 退款
|
||||
order_id: 订单ID;传入时同步更新该订单派单归属客服的日统计
|
||||
|
||||
说明:
|
||||
- 金额必须大于0,否则不执行任何操作
|
||||
@@ -253,6 +254,12 @@ def update_shangjia_daily(yonghuid, amount, action):
|
||||
# 执行原子更新
|
||||
MerchantDailyStats.query.filter(id=stat.id).update(**update_fields)
|
||||
|
||||
if order_id:
|
||||
try:
|
||||
from merchant_ops.services.stats import sync_staff_stats_by_order_id
|
||||
sync_staff_stats_by_order_id(order_id, amount, action)
|
||||
except Exception:
|
||||
logger.warning('同步客服日统计失败 order_id=%s', order_id, exc_info=True)
|
||||
|
||||
|
||||
def update_guanshi_daily_by_action(yonghuid, action, amount=Decimal('0.00')):
|
||||
|
||||
Reference in New Issue
Block a user