From b305b22a8a7f4e80192a8d4501ca73650f485494 Mon Sep 17 00:00:00 2001 From: yystopf Date: Mon, 20 Nov 2023 09:11:28 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9A=E9=A1=B9?= =?UTF-8?q?=E7=9B=AEid=E4=B8=BA0=E6=97=B6=E6=9F=A5=E8=AF=A2=E5=85=A8?= =?UTF-8?q?=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/api/v1/issues/list_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/api/v1/issues/list_service.rb b/app/services/api/v1/issues/list_service.rb index 588e63236..17db797a6 100644 --- a/app/services/api/v1/issues/list_service.rb +++ b/app/services/api/v1/issues/list_service.rb @@ -49,7 +49,7 @@ class Api::V1::Issues::ListService < ApplicationService private def issue_query_data - issues = @project.issues.issue_issue + issues = @project&.id.zero? ? Issue.issue_issue : @project.issues.issue_issue case participant_category when 'aboutme' # 关于我的 From 8030d7db1a732df76eec36e9ac99ab170bf36da0 Mon Sep 17 00:00:00 2001 From: yystopf Date: Mon, 20 Nov 2023 09:38:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9A=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=B7=A5=E4=BD=9C=E9=A1=B9=E9=9C=80=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=AD=90=E5=B7=A5=E4=BD=9C=E9=A1=B9=E6=94=BE=E5=88=B0=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/issue.rb | 1 + app/services/api/v1/issues/delete_service.rb | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index 210f3a61f..bc09c1340 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -82,6 +82,7 @@ class Issue < ApplicationRecord has_many :assigners, through: :issue_assigners has_many :issue_participants, dependent: :destroy has_many :participants, through: :issue_participants + has_many :children_issues, class_name: 'Issue', foreign_key: :root_id, dependent: :destroy has_many :show_participants, -> {joins(:issue_participants).where.not(issue_participants: {participant_type: 'atme'}).distinct}, through: :issue_participants, source: :participant has_many :show_assigners, -> {joins(:issue_assigners).distinct}, through: :issue_assigners, source: :assigner has_many :show_issue_tags, -> {joins(:issue_tags_relates).distinct}, through: :issue_tags_relates, source: :issue_tag diff --git a/app/services/api/v1/issues/delete_service.rb b/app/services/api/v1/issues/delete_service.rb index 7f4f5968d..02b2b533c 100644 --- a/app/services/api/v1/issues/delete_service.rb +++ b/app/services/api/v1/issues/delete_service.rb @@ -15,8 +15,6 @@ class Api::V1::Issues::DeleteService < ApplicationService raise Error, errors.full_messages.join(", ") unless valid? try_lock("Api::V1::Issues::DeleteService:#{project.id}") # 开始写数据,加锁 - delete_zi_issues - delete_issue project.incre_project_issue_cache_delete_count @@ -39,10 +37,4 @@ class Api::V1::Issues::DeleteService < ApplicationService def delete_issue raise Error, "删除疑修失败!" unless issue.destroy! end - - def delete_zi_issues - zi_issues = Issue.where(pm_project_id:issue.pm_project_id, root_id: issue.id) - raise Error, "删除疑修关联项失败!" unless zi_issues.destroy_all - end - end \ No newline at end of file