refactor: update Conversation model to include CustomerName, adjust related logic and queries

This commit is contained in:
mlogclub
2026-04-27 19:27:24 +08:00
parent 3a9bc4914a
commit d713bd5158
7 changed files with 108 additions and 45 deletions
@@ -91,6 +91,11 @@ func (r *conversationRepository) Updates(db *gorm.DB, id int64, columns map[stri
return
}
func (r *conversationRepository) UpdatesByCustomerID(db *gorm.DB, customerID int64, columns map[string]interface{}) (err error) {
err = db.Model(&models.Conversation{}).Where("customer_id = ?", customerID).Updates(columns).Error
return
}
func (r *conversationRepository) UpdateColumn(db *gorm.DB, id int64, name string, value interface{}) (err error) {
err = db.Model(&models.Conversation{}).Where("id = ?", id).UpdateColumn(name, value).Error
return