Skip to content
Snippets Groups Projects
Commit 4b8ed71f authored by Richard Fernando Heise Ferreira's avatar Richard Fernando Heise Ferreira
Browse files

Merge branch 'issue/60-rota-statistics-usuarios-unicos' into 'develop'

[add] unique user count to route statistics

See merge request rfhf19/cleanning-portalmec!55
parents 1ee7fa97 13d17f13
No related branches found
No related tags found
1 merge request!55[add] unique user count to route statistics
Pipeline #37007 failed
......@@ -21,7 +21,7 @@ class V1::StatisticsController < ApplicationController
# GET v1/statistics
# GET v1/statistics.json
def index
statistics = { count: count_learning_objects, month_publications: month_publications, month_downloads: month_downloads }
statistics = { count: count_learning_objects, month_publications: month_publications, month_downloads: month_downloads, unique_users: unique_users}
render json: statistics
end
......@@ -38,4 +38,8 @@ class V1::StatisticsController < ApplicationController
def month_downloads
Download.where('extract (month from created_at) = ? and extract (year from created_at) = ?', Time.current.month, Time.current.year).count
end
def unique_users
User.distinct.count
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment