mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-22 12:45:46 +08:00
update
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
# pm_sprint_id :integer
|
||||
# pm_issue_type :integer
|
||||
# time_scale :decimal(10, 2) default("0.00")
|
||||
# child_count :integer default("0")
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
@@ -97,7 +98,7 @@ class Issue < ApplicationRecord
|
||||
scope :issue_index_includes, ->{includes(:tracker, :priority, :version, :issue_status, :journals,:issue_tags,user: :user_extension)}
|
||||
scope :closed, ->{where(status_id: 5)}
|
||||
scope :opened, ->{where.not(status_id: 5)}
|
||||
after_create :incre_project_common, :incre_user_statistic, :incre_platform_statistic
|
||||
after_create :incre_project_common, :incre_user_statistic, :incre_platform_statistic, :fresh_root_issue_count
|
||||
after_save :change_versions_count, :send_update_message_to_notice_system, :associate_attachment_container
|
||||
after_destroy :update_closed_issues_count_in_project!, :decre_project_common, :decre_user_statistic, :decre_platform_statistic
|
||||
|
||||
@@ -117,6 +118,12 @@ class Issue < ApplicationRecord
|
||||
CacheAsyncSetJob.perform_later('user_statistic_service', {issue_count: -1}, self.author_id)
|
||||
end
|
||||
|
||||
def fresh_root_issue_count
|
||||
return if root_id.nil? || root_id.zero?
|
||||
root_issue = Issue.find_by(id: root_id)
|
||||
root_count = Issue.where(root_id: root_id).count
|
||||
root_issue.update(child_count: root_count)
|
||||
end
|
||||
def incre_platform_statistic
|
||||
CacheAsyncSetJob.perform_later('platform_statistic_service', {issue_count: 1})
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user