@ -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
err = dbConn . Model ( & db . Conversation { } ) . Where ( "owner_user_id IN ? and conversation_id=?" , ownerUserIDList , conversationID ) . Find ( & conversations ) . Error
return conversations , err
return conversations , err
}
}
func GetExistConversationUserIDList ( conversationID string ) ( [ ] string , error ) {
func GetExistConversationUserIDList ( ownerUserIDList [ ] string , conversationID string ) ( [ ] string , error ) {
dbConn , err := db . DB . MysqlDB . DefaultGormDB ( )
dbConn , err := db . DB . MysqlDB . DefaultGormDB ( )
if err != nil {
if err != nil {
return nil , err
return nil , err
}
}
var resultArr [ ] string
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 {
if err != nil {
return nil , err
return nil , err
}
}