conversation update

This commit is contained in:
Gordon
2022-04-25 19:56:46 +08:00
committed by Xinwei Xiong(cubxxw-openim)
parent a994ef5f67
commit 7c007e54a3
2 changed files with 3 additions and 3 deletions
@@ -93,13 +93,13 @@ func GetMultipleUserConversationByConversationID(ownerUserIDList []string, conve
err = dbConn.Model(&db.Conversation{}).Where("owner_user_id IN ? and conversation_id=?", ownerUserIDList, conversationID).Find(&conversations).Error
return conversations, err
}
func GetExistConversationUserIDList(conversationID string) ([]string, error) {
func GetExistConversationUserIDList(ownerUserIDList []string, conversationID string) ([]string, error) {
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
if err != nil {
return nil, err
}
var resultArr []string
err = dbConn.Table("conversations").Where(" conversation_id=?", conversationID).Pluck("owner_user_id", &resultArr).Error
err = dbConn.Table("conversations").Where(" owner_user_id IN (?) and conversation_id=?", ownerUserIDList, conversationID).Pluck("owner_user_id", &resultArr).Error
if err != nil {
return nil, err
}