优化客服群聊订单信息展示

This commit is contained in:
yml
2026-06-18 00:44:45 +08:00
parent 0add23dedb
commit 272b2cb71e
15 changed files with 479 additions and 55 deletions
+3 -1
View File
@@ -14,6 +14,7 @@ import (
type conversationRow struct {
ID uint64
OrderID *uint64
ListingID *uint64
Type string
Title string
Status string
@@ -28,7 +29,7 @@ type conversationRow struct {
func (r *Repository) conversationQuery(ctx context.Context, principal Principal) *gorm.DB {
return r.db.WithContext(ctx).Table("chat_conversations AS c").
Select(`c.id, c.order_id, c.type, c.title, c.status, c.last_message_id,
Select(`c.id, c.order_id, c.listing_id, c.type, c.title, c.status, c.last_message_id,
c.last_message_preview, c.last_message_at, c.created_at, c.updated_at, cp.role,
(
SELECT COUNT(1)
@@ -282,6 +283,7 @@ func (row conversationRow) toDTO(participants []ParticipantDTO) ConversationDTO
return ConversationDTO{
ID: row.ID,
OrderID: row.OrderID,
ListingID: row.ListingID,
Type: row.Type,
Title: row.Title,
Status: row.Status,