更改:今日待办数据查询

This commit is contained in:
yystopf 2025-07-11 16:11:03 +08:00
parent b12711dba3
commit 59f987fb80
1 changed files with 2 additions and 2 deletions

View File

@ -11,11 +11,11 @@ class Api::Pm::DashboardsController < Api::Pm::BaseController
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 is null and due_date >=?", date).to_sql
requirement_bug_issue3 = Issue.where(pm_issue_type: [1,3]).where("start_date <=? and due_date is null", date + 15.days, nil).to_sql
requirement_bug_issue4 = Issue.where(pm_issue_type: [1,3]).where("start_date is null and due_date is null").where("created_on <=?", date + 15.days).to_sql
requirement_bug_issue4 = Issue.where(pm_issue_type: [1,3]).where("start_date is null and due_date is null and 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 is null and plan_end_date >=?", date).to_sql
task_issue_3 = Issue.where(pm_issue_type: 2).where("plan_start_date <=? and plan_end_date is null", date + 15.days).to_sql
task_issue_4 = Issue.where(pm_issue_type: 2).where("plan_start_date is null and plan_end_date is null").where("created_on <=?", date + 15.days).to_sql
task_issue_4 = Issue.where(pm_issue_type: 2).where("plan_start_date is null and plan_end_date is null and 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