Merge pull request '工作项部分修改' (#226) from yystopf/forgeplus:pm_project_develop into pm_project_develop
This commit is contained in:
commit
e683dddcaf
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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' # 关于我的
|
||||
|
|
Loading…
Reference in New Issue