|
|
|
@@ -17,9 +17,9 @@ class Admins::DashboardsController < Admins::BaseController |
|
|
|
@month_new_user_count = User.where(created_on: current_month).count |
|
|
|
|
|
|
|
# 活跃项目数 |
|
|
|
day_project_ids = CommitLog.where(created_at: today).pluck(:project_id).uniq |
|
|
|
weekly_project_ids = CommitLog.where(created_at: current_week).pluck(:project_id).uniq |
|
|
|
month_project_ids = CommitLog.where(created_at: current_month).pluck(:project_id).uniq |
|
|
|
day_project_ids = (CommitLog.where(created_at: today).pluck(:project_id).uniq + Issue.where(created_on: today).pluck(:project_id).uniq).uniq |
|
|
|
weekly_project_ids = (CommitLog.where(created_at: current_week).pluck(:project_id).uniq + Issue.where(created_on: current_week).pluck(:project_id).uniq).uniq |
|
|
|
month_project_ids = (CommitLog.where(created_at: current_month).pluck(:project_id).uniq + Issue.where(created_on: current_month).pluck(:project_id).uniq).uniq |
|
|
|
@day_active_project_count = Project.where(updated_on: today).or(Project.where(id: day_project_ids)).count |
|
|
|
@weekly_active_project_count = Project.where(updated_on: current_week).or(Project.where(id: weekly_project_ids)).count |
|
|
|
@month_active_project_count = Project.where(updated_on: current_month).or(Project.where(id: month_project_ids)).count |
|
|
|
|