perf(chat): 分页客服会话并拆分统计查询
This commit is contained in:
@@ -195,7 +195,7 @@ func AddRenterToListingConversation(tx *gorm.DB, listingID uint64, renterID uint
|
||||
if handoffSupportID > 0 {
|
||||
message += ",卖号组客服已接入"
|
||||
}
|
||||
return sendSystemMessage(tx, conv.ID, message)
|
||||
return sendSystemMessageWithAttention(tx, conv.ID, message, "order_paid")
|
||||
}
|
||||
|
||||
// RemoveRenterFromListingConversation 移出租客,返回是否真的删除了租客成员记录。
|
||||
@@ -248,13 +248,18 @@ func getListingGroupWelcomeMessage(tx *gorm.DB) string {
|
||||
}
|
||||
|
||||
func sendSystemMessage(tx *gorm.DB, conversationID uint64, content string) error {
|
||||
return sendSystemMessageWithAttention(tx, conversationID, content, "")
|
||||
}
|
||||
|
||||
func sendSystemMessageWithAttention(tx *gorm.DB, conversationID uint64, content, attentionType string) error {
|
||||
message := model.ChatMessage{
|
||||
ConversationID: conversationID,
|
||||
SenderType: "system",
|
||||
SenderRole: "system",
|
||||
ContentType: "system",
|
||||
Content: content,
|
||||
AttachmentURLS: emptyJSONList(),
|
||||
ConversationID: conversationID,
|
||||
SenderType: "system",
|
||||
SenderRole: "system",
|
||||
ContentType: "system",
|
||||
Content: content,
|
||||
AttachmentURLS: emptyJSONList(),
|
||||
AdminAttentionType: attentionType,
|
||||
}
|
||||
|
||||
if err := tx.Create(&message).Error; err != nil {
|
||||
|
||||
Reference in New Issue
Block a user