fix(chat): 区分咨询与正常会话待处理规则

This commit is contained in:
yml2213
2026-08-25 21:11:52 +08:00
parent cc91979b34
commit cdab2d8157
2 changed files with 14 additions and 4 deletions
+2 -2
View File
@@ -239,7 +239,7 @@ func (r *Repository) listAdminConversations(ctx context.Context, principal Princ
COALESCE(explicit_lo.handoff_status, listing_lo.handoff_status) AS latest_handoff_status,
COALESCE(explicit_lo.refund_status, listing_lo.refund_status) AS latest_refund_status,
lm.sender_type AS last_sender_type, lm.sender_id AS last_sender_id, lm.sender_role AS last_sender_role,
CASE WHEN ` + adminNeedsReplyExpression() + ` THEN 1 ELSE 0 END AS needs_reply,
CASE WHEN c.type = 'general_support' AND (` + adminNeedsReplyExpression() + `) THEN 1 ELSE 0 END AS needs_reply,
(
SELECT COUNT(1)
FROM chat_messages AS cm
@@ -415,7 +415,7 @@ func adminChatStageCondition(stage string, principal Principal) (string, []inter
latestRefundStatus := "COALESCE(explicit_lo.refund_status, listing_lo.refund_status)"
switch stage {
case adminChatStagePending:
return adminNeedsReplyExpression(), nil
return "c.type = 'general_support' AND (" + adminNeedsReplyExpression() + ")", nil
case adminChatStageUnjoined:
return latestID + " IS NULL", nil
case adminChatStageHandoff: