PLT-5070: Server side component of Telemetry. (#5514)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ba028ed74b
Коммит
f182d196ff
@@ -1362,6 +1362,32 @@ func (s SqlChannelStore) AnalyticsTypeCount(teamId string, channelType string) S
|
||||
return storeChannel
|
||||
}
|
||||
|
||||
func (s SqlChannelStore) AnalyticsDeletedTypeCount(teamId string, channelType string) StoreChannel {
|
||||
storeChannel := make(StoreChannel, 1)
|
||||
|
||||
go func() {
|
||||
result := StoreResult{}
|
||||
|
||||
query := "SELECT COUNT(Id) AS Value FROM Channels WHERE Type = :ChannelType AND DeleteAt > 0"
|
||||
|
||||
if len(teamId) > 0 {
|
||||
query += " AND TeamId = :TeamId"
|
||||
}
|
||||
|
||||
v, err := s.GetReplica().SelectInt(query, map[string]interface{}{"TeamId": teamId, "ChannelType": channelType})
|
||||
if err != nil {
|
||||
result.Err = model.NewLocAppError("SqlChannelStore.AnalyticsDeletedTypeCount", "store.sql_channel.analytics_deleted_type_count.app_error", nil, err.Error())
|
||||
} else {
|
||||
result.Data = v
|
||||
}
|
||||
|
||||
storeChannel <- result
|
||||
close(storeChannel)
|
||||
}()
|
||||
|
||||
return storeChannel
|
||||
}
|
||||
|
||||
func (s SqlChannelStore) ExtraUpdateByUser(userId string, time int64) StoreChannel {
|
||||
storeChannel := make(StoreChannel, 1)
|
||||
|
||||
@@ -1546,6 +1572,7 @@ func (s SqlChannelStore) GetMembersByIds(channelId string, userIds []string) Sto
|
||||
result.Err = model.NewLocAppError("SqlChannelStore.GetMembersByIds", "store.sql_channel.get_members_by_ids.app_error", nil, "channelId="+channelId+" "+err.Error())
|
||||
} else {
|
||||
result.Data = &members
|
||||
|
||||
}
|
||||
|
||||
storeChannel <- result
|
||||
|
||||
Ссылка в новой задаче
Block a user