From 1c325f412f22f0ca69401e7332951bcb4930b5cb Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 22 May 2025 08:48:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=8F=82=E6=95=B0?= =?UTF-8?q?=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/weekly_issues_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/pm/weekly_issues_controller.rb b/app/controllers/api/pm/weekly_issues_controller.rb index e31869fbf..da71a8f7d 100644 --- a/app/controllers/api/pm/weekly_issues_controller.rb +++ b/app/controllers/api/pm/weekly_issues_controller.rb @@ -2,7 +2,9 @@ class Api::Pm::WeeklyIssuesController < ApplicationController def personal @enterprise_identifier = params[:enterprise_identifier] || '' - @all_issues = Issue.where(enterprise_identifier: @enterprise_identifier, pm_issue_type: [1,2,3]) + return render_error('请输入正确的用户ID.') if params[:user_id].blank? + @all_issues = Issue.joins(:issue_participants).where(issue_participants: {participant_id: params[:user_id], participant_type: ['authored', 'assigned']}) + @all_issues = @all_issues.where(enterprise_identifier: @enterprise_identifier, pm_issue_type: [1,2,3]) @this_week_all_issues = @all_issues.where("due_date >= ? and start_date <= ?", Date.today.beginning_of_week.to_s, Date.today.end_of_week.to_s) @this_week_all_issues = @this_week_all_issues.order('created_on desc') @next_week_all_issues = @all_issues.where("due_date >= ? and start_date <=?", (Date.today.beginning_of_week+1.week).to_s, (Date.today.end_of_week+1.week).to_s) @@ -18,6 +20,7 @@ class Api::Pm::WeeklyIssuesController < ApplicationController def group @enterprise_identifier = params[:enterprise_identifier] || '' @all_issues = Issue.where(enterprise_identifier: @enterprise_identifier, pm_issue_type: [1,2,3]) + @all_issues = @all_issues.where(pm_project_id: params[:pm_project_ids].split(",")) if params[:pm_project_ids].present? @this_week_all_issues = @all_issues.where("due_date >= ? and start_date <= ?", Date.today.beginning_of_week.to_s, Date.today.end_of_week.to_s) @this_week_all_issues_group_count = @this_week_all_issues.group(:pm_project_id).count data = {}