diff --git a/app/controllers/report_controller.rb b/app/controllers/report_controller.rb new file mode 100644 --- /dev/null +++ b/app/controllers/report_controller.rb @@ -0,0 +1,13 @@ +class ReportController < ApplicationController + def login_stat + @logins = Array.new + login = Login.all + User.all.each do |user| + @logins << { login: user.login, + full_name: user.full_name, + count: Login.where(user_id: user.id).count(:id), + min: Login.where(user_id: user.id).maximum(:created_at), + max: Login.where(user_id: user.id).minimum(:created_at) } + end + end +end