支持后台转移发布所有权
This commit is contained in:
@@ -22,7 +22,7 @@ var (
|
||||
)
|
||||
|
||||
// EnsureListingConversation 确保发布群存在(幂等)
|
||||
func EnsureListingConversation(tx *gorm.DB, listing model.RentalListing) (*model.ChatConversation, error) {
|
||||
func EnsureListingConversation(tx *gorm.DB, listing model.RentalListing, preferredSupportAdminID uint64) (*model.ChatConversation, error) {
|
||||
// 1. 幂等查重
|
||||
var existing model.ChatConversation
|
||||
err := tx.Where("listing_id = ?", listing.ID).First(&existing).Error
|
||||
@@ -56,8 +56,12 @@ func EnsureListingConversation(tx *gorm.DB, listing model.RentalListing) (*model
|
||||
},
|
||||
}
|
||||
|
||||
// 获取客服
|
||||
if supportID := defaultSupportAdminID(tx); supportID > 0 {
|
||||
// 获取客服。开放上传场景优先拉上传管理员,普通发布回退到默认客服。
|
||||
supportID := preferredSupportAdminID
|
||||
if supportID <= 0 {
|
||||
supportID = defaultSupportAdminID(tx)
|
||||
}
|
||||
if supportID > 0 {
|
||||
participants = append(participants, model.ChatParticipant{
|
||||
ConversationID: conversation.ID,
|
||||
ParticipantType: "admin",
|
||||
|
||||
Reference in New Issue
Block a user