mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Update stats query
This commit is contained in:
parent
58ffca74f6
commit
6e5dd4bed6
1 changed files with 5 additions and 5 deletions
|
|
@ -6,12 +6,12 @@ class StatsQuery
|
|||
end
|
||||
|
||||
def points_stats
|
||||
result = user.tracked_points.connection.execute(<<~SQL.squish)
|
||||
SELECT#{' '}
|
||||
COUNT(*) as total,
|
||||
result = Point.connection.execute(<<~SQL.squish)
|
||||
SELECT
|
||||
COUNT(id) as total,
|
||||
COUNT(reverse_geocoded_at) as geocoded,
|
||||
COUNT(CASE WHEN geodata = '{}' THEN 1 END) as without_data
|
||||
FROM points#{' '}
|
||||
COUNT(CASE WHEN geodata = '{}'::jsonb THEN 1 END) as without_data
|
||||
FROM points
|
||||
WHERE user_id = #{user.id}
|
||||
SQL
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue