From bfd2c1d5c7507cd6619f4bde20692d45ccedff23 Mon Sep 17 00:00:00 2001 From: xiaoxiaoqiong Date: Tue, 19 Jul 2022 09:31:51 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E5=90=8E=E5=8F=B0=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BC=98=E5=8C=96,issue=E5=BD=93=E6=88=90=E6=B4=BB=E8=B7=83?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8C=87=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admins/dashboards_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admins/dashboards_controller.rb b/app/controllers/admins/dashboards_controller.rb index 5ac1508d1..1c2c49d3c 100644 --- a/app/controllers/admins/dashboards_controller.rb +++ b/app/controllers/admins/dashboards_controller.rb @@ -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