err:=db.DB.MysqlDB.DefaultGormDB().Model(&db.Conversation{}).Where("owner_user_id IN ? and conversation_id=?",ownerUserIDList,conversationID).Find(&conversations).Error
err:=db.DB.MysqlDB.DefaultGormDB().Model(&Conversation{}).Where("owner_user_id IN ? and conversation_id=?",ownerUserIDList,conversationID).Find(&conversations).Error
err:=db.DB.MysqlDB.DefaultGormDB().Table("conversations").Where("owner_user_id=? and conversation_id=?",OwnerUserID,conversationID).Take(&conversation).Error
err:=db.DB.MysqlDB.DefaultGormDB().Table("conversations").Where("owner_user_id=? and conversation_id=?",OwnerUserID,conversationID).Take(&conversation).Error
err:=db.DB.MysqlDB.DefaultGormDB().Model(&db.Conversation{}).Where("conversation_id IN (?) and owner_user_id=?",conversationIDs,OwnerUserID).Find(&conversations).Error
err:=db.DB.MysqlDB.DefaultGormDB().Model(&Conversation{}).Where("conversation_id IN (?) and owner_user_id=?",conversationIDs,OwnerUserID).Find(&conversations).Error
err:=db.DB.MysqlDB.DefaultGormDB().Model(&db.Conversation{}).Where("owner_user_id IN (?) and conversation_id=?",OwnerUserIDList,conversationID).Find(&conversations).Error
err:=db.DB.MysqlDB.DefaultGormDB().Model(&Conversation{}).Where("owner_user_id IN (?) and conversation_id=?",OwnerUserIDList,conversationID).Find(&conversations).Error
returndb.DB.MysqlDB.DefaultGormDB().Model(&db.Conversation{}).Where("owner_user_id IN (?) and conversation_id=?",ownerUserIDList,conversationID).Updates(args).Error
returndb.DB.MysqlDB.DefaultGormDB().Model(&Conversation{}).Where("owner_user_id IN (?) and conversation_id=?",ownerUserIDList,conversationID).Updates(args).Error
returndb.DB.MysqlDB.DefaultGormDB().Table("group_members").Where("group_id=? and user_id=?",groupMemberInfo.GroupID,groupMemberInfo.UserID).Updates(&groupMemberInfo).Error
returndb.DB.MysqlDB.DefaultGormDB().Table("group_members").Where("group_id=? and user_id=?",groupMemberInfo.GroupID,groupMemberInfo.UserID).Updates(&groupMemberInfo).Error
returndb.DB.MysqlDB.DefaultGormDB().Table("group_members").Where("group_id=? and user_id=?",groupMemberInfo.GroupID,groupMemberInfo.UserID).Updates(m).Error
returndb.DB.MysqlDB.DefaultGormDB().Table("group_members").Where("group_id=? and user_id=?",groupMemberInfo.GroupID,groupMemberInfo.UserID).Updates(m).Error
err:=db.DB.MysqlDB.DefaultGormDB().Table("group_members").Where("group_id=? and role_level>?",groupID,constant.GroupOrdinaryUsers).Find(&groupMemberList).Error
err:=db.DB.MysqlDB.DefaultGormDB().Table("group_members").Where("group_id=? and role_level>?",groupID,constant.GroupOrdinaryUsers).Find(&groupMemberList).Error
err:=db.DB.MysqlDB.DefaultGormDB().Table("group_members").Where("group_id=?",groupId).Where(fmt.Sprintf(" nickname like '%%%s%%' ",userName)).Limit(int(showNumber)).Offset(int(showNumber*(pageNumber-1))).Find(&groupMembers).Error
err:=db.DB.MysqlDB.DefaultGormDB().Table("group_members").Where("group_id=?",groupId).Where(fmt.Sprintf(" nickname like '%%%s%%' ",userName)).Limit(int(showNumber)).Offset(int(showNumber*(pageNumber-1))).Find(&groupMembers).Error
returndb.DB.MysqlDB.DefaultGormDB().Table("group_requests").Where("group_id=? and user_id=?",groupRequest.GroupID,groupRequest.UserID).Updates(&groupRequest).Error
returndb.DB.MysqlDB.DefaultGormDB().Table("group_requests").Where("group_id=? and user_id=?",groupRequest.GroupID,groupRequest.UserID).Updates(&groupRequest).Error
iferr:=db.DB.MysqlDB.DefaultGormDB().Table("department_members").Where("department_id=? AND user_id=?",departmentMember.DepartmentID,departmentMember.UserID).
iferr:=db.DB.MysqlDB.DefaultGormDB().Table("department_members").Where("department_id=? AND user_id=?",departmentMember.DepartmentID,departmentMember.UserID).
returndb.DB.MysqlDB.DefaultGormDB().Table("department_members").Where("department_id=? AND user_id=?",departmentID,userID).Delete(db.DepartmentMember{}).Error
returndb.DB.MysqlDB.DefaultGormDB().Table("department_members").Where("department_id=? AND user_id=?",departmentID,userID).Delete(DepartmentMember{}).Error
err:=db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").Select("recv_id, count(*) as message_num").Where("send_time >= ? and send_time <= ? and session_type in (?)",from,to,[]int{constant.GroupChatType,constant.SuperGroupChatType}).Group("recv_id").Limit(limit).Order("message_num DESC").Find(&activeGroups).Error
err:=db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").Select("recv_id, count(*) as message_num").Where("send_time >= ? and send_time <= ? and session_type in (?)",from,to,[]int{constant.GroupChatType,constant.SuperGroupChatType}).Group("recv_id").Limit(limit).Order("message_num DESC").Find(&activeGroups).Error
err:=db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").Select("send_id, count(*) as message_num").Where("send_time >= ? and send_time <= ? and session_type = ?",from,to,constant.SingleChatType).Group("send_id").Limit(limit).Order("message_num DESC").Find(&activeUsers).Error
err:=db.DB.MysqlDB.DefaultGormDB().Table("chat_logs").Select("send_id, count(*) as message_num").Where("send_time >= ? and send_time <= ? and session_type = ?",from,to,constant.SingleChatType).Group("send_id").Limit(limit).Order("message_num DESC").Find(&activeUsers).Error
err:=db.DB.MysqlDB.DefaultGormDB().Table("users").Where(" name like ?",fmt.Sprintf("%%%s%%",userName)).Limit(int(showNumber)).Offset(int(showNumber*(pageNumber-1))).Find(&users).Error
err:=db.DB.MysqlDB.DefaultGormDB().Table("users").Where(" name like ?",fmt.Sprintf("%%%s%%",userName)).Limit(int(showNumber)).Offset(int(showNumber*(pageNumber-1))).Find(&users).Error