fixed 用户活跃数
This commit is contained in:
parent
ae0efc1115
commit
fce8166ba7
|
@ -1,9 +1,9 @@
|
||||||
class Admins::DashboardsController < Admins::BaseController
|
class Admins::DashboardsController < Admins::BaseController
|
||||||
def index
|
def index
|
||||||
# 用户活跃数
|
# 用户活跃数
|
||||||
day_user_ids = CommitLog.where(created_at: today).pluck(:project_id).uniq
|
day_user_ids = CommitLog.where(created_at: today).pluck(:user_id).uniq
|
||||||
weekly_user_ids = CommitLog.where(created_at: current_week).pluck(:project_id).uniq
|
weekly_user_ids = CommitLog.where(created_at: current_week).pluck(:user_id).uniq
|
||||||
month_user_ids = CommitLog.where(created_at: current_month).pluck(:project_id).uniq
|
month_user_ids = CommitLog.where(created_at: current_month).pluck(:user_id).uniq
|
||||||
@active_user_count = User.where(last_login_on: today).or(User.where(id: day_user_ids)).count
|
@active_user_count = User.where(last_login_on: today).or(User.where(id: day_user_ids)).count
|
||||||
@weekly_active_user_count = User.where(last_login_on: current_week).or(User.where(id: weekly_user_ids)).count
|
@weekly_active_user_count = User.where(last_login_on: current_week).or(User.where(id: weekly_user_ids)).count
|
||||||
@month_active_user_count = User.where(last_login_on: current_month).or(User.where(id: month_user_ids)).count
|
@month_active_user_count = User.where(last_login_on: current_month).or(User.where(id: month_user_ids)).count
|
||||||
|
|
Loading…
Reference in New Issue