From 41cbeae2f7c86a8d6e46e0faae2dfa6d7825b375 Mon Sep 17 00:00:00 2001 From: yystopf Date: Sat, 7 Jun 2025 14:48:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9A=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E6=88=91=E8=B4=9F=E8=B4=A3=E6=88=96=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E9=A1=B9=E9=9C=80=E8=A6=81=E6=8C=89=E5=B1=82?= =?UTF-8?q?=E7=BA=A7=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/pm/weekly_issues_controller.rb | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/pm/weekly_issues_controller.rb b/app/controllers/api/pm/weekly_issues_controller.rb index dac4d65d3..564333535 100644 --- a/app/controllers/api/pm/weekly_issues_controller.rb +++ b/app/controllers/api/pm/weekly_issues_controller.rb @@ -55,7 +55,15 @@ class Api::Pm::WeeklyIssuesController < Api::Pm::BaseController def group_issues @enterprise_identifier = params[:enterprise_identifier] || '' - @all_issues = Issue.where(enterprise_identifier: @enterprise_identifier, pm_issue_type: [1,2,3]) + root_id = params[:root_id] || -1 + @all_issues = Issue.none + if root_id.to_i == -1 + @all_issues = Issue.where(root_id: nil, enterprise_identifier: @enterprise_identifier, pm_issue_type: [1,2,3]) + elsif root_id.to_i.positive? + @all_issues = Issue.where(root_id: root_id, enterprise_identifier: @enterprise_identifier, pm_issue_type: [1,2,3]) + else + @all_issues = Issue.where(enterprise_identifier: @enterprise_identifier, pm_issue_type: [1,2,3]) + end @all_issues = @all_issues.where(pm_project_id: params[:pm_project_ids].split(",")) if params[:pm_project_ids].present? @all_issues = @all_issues.where(pm_issue_type: params[:pm_issue_type].to_i) if params[:pm_issue_type].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) @@ -65,7 +73,13 @@ class Api::Pm::WeeklyIssuesController < Api::Pm::BaseController def personal_issues @enterprise_identifier = params[:enterprise_identifier] || '' 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: ['assigned']}) + root_id = params[:root_id] || -1 + @all_issues = Issue.none + if root_id.to_i == -1 + @all_issues = Issue.joins(:issue_participants).where(root_id: nil, issue_participants: {participant_id: params[:user_id], participant_type: ['assigned']}) + else + @all_issues = Issue.joins(:issue_participants).where(root_id: root_id, issue_participants: {participant_id: params[:user_id], participant_type: ['assigned']}) + end @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).distinct @this_week_all_issues = @this_week_all_issues.order('created_on desc') From 145463f967df082ed2bbdbe2b023fb4655939c19 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Sat, 7 Jun 2025 15:01:40 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fixed=20=E6=B5=81=E6=B0=B4=E7=BA=BF?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=B6=E5=88=A0=E9=99=A4=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/projects/pipelines_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v1/projects/pipelines_controller.rb b/app/controllers/api/v1/projects/pipelines_controller.rb index 6985e8b05..0f8ea7d52 100644 --- a/app/controllers/api/v1/projects/pipelines_controller.rb +++ b/app/controllers/api/v1/projects/pipelines_controller.rb @@ -148,7 +148,7 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController interactor = Gitea::DeleteFileInteractor.call(current_user.gitea_token, @owner.login, del_content_params(sha).merge(identifier: @project.identifier)) tip_exception(interactor.error) unless interactor.success? end - Gitea::ActionRun.where(repo_id: @pipeline.project.gpid).destroy_all + Gitea::ActionRun.where(repo_id: @pipeline.project.gpid, workflow_id: "#{@pipeline.pipeline_name}.yml").destroy_all @pipeline.destroy! end render_ok