优化发布群配置与二维码池界面
This commit is contained in:
@@ -189,14 +189,12 @@ func listingConversationTitle(listing model.RentalListing) string {
|
||||
}
|
||||
|
||||
func getListingGroupWelcomeMessage(tx *gorm.DB) string {
|
||||
defaultMsg := "欢迎加入账号群!请号主扫描下方二维码加入企业微信群,方便客服与您及时联系。"
|
||||
|
||||
var cfg model.SystemConfig
|
||||
if err := tx.Where("`key` = ?", "chat.listing_group_welcome").First(&cfg).Error; err == nil && cfg.Value != "" {
|
||||
if err := tx.Where("`key` = ?", listingGroupWelcomeConfigKey).First(&cfg).Error; err == nil && cfg.Value != "" {
|
||||
return cfg.Value
|
||||
}
|
||||
|
||||
return defaultMsg
|
||||
return defaultListingGroupWelcome
|
||||
}
|
||||
|
||||
func sendSystemMessage(tx *gorm.DB, conversationID uint64, content string) error {
|
||||
@@ -218,7 +216,6 @@ func sendSystemMessage(tx *gorm.DB, conversationID uint64, content string) error
|
||||
}
|
||||
|
||||
func sendQrCodeImage(tx *gorm.DB, conversationID uint64, imageURL string) error {
|
||||
attachmentURLs := `["` + imageURL + `"]`
|
||||
content := "👇 请扫码加入企业微信群"
|
||||
|
||||
message := model.ChatMessage{
|
||||
@@ -227,7 +224,7 @@ func sendQrCodeImage(tx *gorm.DB, conversationID uint64, imageURL string) error
|
||||
SenderRole: "system",
|
||||
ContentType: "image",
|
||||
Content: content,
|
||||
AttachmentURLS: []byte(attachmentURLs),
|
||||
AttachmentURLS: encodeStringList([]string{imageURL}),
|
||||
}
|
||||
|
||||
if err := tx.Create(&message).Error; err != nil {
|
||||
|
||||
Reference in New Issue
Block a user