优化客服群聊订单信息展示
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user