From 803b0b6c8c1b520f6bc513b4c95719e271a10d97 Mon Sep 17 00:00:00 2001 From: yystopf Date: Fri, 11 Jul 2025 15:31:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9A=E4=BB=8A=E6=97=A5?= =?UTF-8?q?=E5=BE=85=E5=8A=9E=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/pm/dashboards_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/pm/dashboards_controller.rb b/app/controllers/api/pm/dashboards_controller.rb index 81ddc846b..a8ac41e34 100644 --- a/app/controllers/api/pm/dashboards_controller.rb +++ b/app/controllers/api/pm/dashboards_controller.rb @@ -10,12 +10,12 @@ class Api::Pm::DashboardsController < Api::Pm::BaseController @issues = Issue.where("start_date <= ? and due_date >= ?", date, date) requirement_bug_issue1 = Issue.where(pm_issue_type: [1,3]).where("start_date <= ? and due_date >= ?", date, date).to_sql requirement_bug_issue2 = Issue.where(pm_issue_type: [1,3]).where("start_date = ? and due_date >=?", nil, date).to_sql - requirement_bug_issue3 = Issue.where(pm_issue_type: [1,3]).where("start_date <=? and due_date = ?", date + 15.days, nil).to_sql - requirement_bug_issue4 = Issue.where(pm_issue_type: [1,3]).where("start_date =? and due_date =?", nil, nil).where("created_on <=?", date + 15.days).to_sql + requirement_bug_issue3 = Issue.where(pm_issue_type: [1,3]).where("start_date <=? and due_date = ?", date - 15.days, nil).to_sql + requirement_bug_issue4 = Issue.where(pm_issue_type: [1,3]).where("start_date =? and due_date =?", nil, nil).where("created_on <=?", date - 15.days).to_sql task_issue_1 = Issue.where(pm_issue_type: 2).where("plan_start_date <=? and plan_end_date >=?", date, date).to_sql task_issue_2 = Issue.where(pm_issue_type: 2).where("plan_start_date =? and plan_end_date >=?", nil, date).to_sql - task_issue_3 = Issue.where(pm_issue_type: 2).where("plan_start_date <=? and plan_end_date =?", date + 15.days, nil).to_sql - task_issue_4 = Issue.where(pm_issue_type: 2).where("plan_start_date =? and plan_end_date =?", nil, nil).where("created_on <=?", date + 15.days).to_sql + task_issue_3 = Issue.where(pm_issue_type: 2).where("plan_start_date <=? and plan_end_date =?", date - 15.days, nil).to_sql + task_issue_4 = Issue.where(pm_issue_type: 2).where("plan_start_date =? and plan_end_date =?", nil, nil).where("created_on <=?", date - 15.days).to_sql @issues = Issue.from("( #{requirement_bug_issue1} union #{requirement_bug_issue2} union #{requirement_bug_issue3} union #{requirement_bug_issue4} union #{task_issue_1} union #{task_issue_2} union #{task_issue_3} union #{task_issue_4} ) as issues") @issues = @issues.where(pm_project_id: pm_project_ids).joins(:issue_participants).where(issue_participants: {participant_id: current_user.id, participant_type: 'assigned'}) issues_1 = @issues.where(pm_issue_type: 1).where.not(status_id: [2,7,8]).to_sql