Fix all count
This commit is contained in:
parent
4079d66f00
commit
5fc84552d3
|
@ -82,7 +82,7 @@ def get_stat_data do
|
||||||
|
|
||||||
defp status_count do
|
defp status_count do
|
||||||
%{
|
%{
|
||||||
all: get_all_statuses_count(),
|
all: all_statuses_query() |> Repo.aggregate(:count, :id),
|
||||||
public: public_statuses_query() |> Repo.aggregate(:count, :id),
|
public: public_statuses_query() |> Repo.aggregate(:count, :id),
|
||||||
unlisted: unlisted_statuses_query() |> Repo.aggregate(:count, :id),
|
unlisted: unlisted_statuses_query() |> Repo.aggregate(:count, :id),
|
||||||
direct: direct_statuses_query() |> Repo.aggregate(:count, :id),
|
direct: direct_statuses_query() |> Repo.aggregate(:count, :id),
|
||||||
|
@ -90,8 +90,8 @@ defp status_count do
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp get_all_statuses_count do
|
defp all_statuses_query do
|
||||||
Repo.aggregate(User.Query.build(%{local: true}), :sum, :note_count)
|
from(o in Object, where: fragment("(?)->>'type' = 'Note'", o.data))
|
||||||
end
|
end
|
||||||
|
|
||||||
def public_statuses_query do
|
def public_statuses_query do
|
||||||
|
|
Loading…
Reference in New Issue