mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
Merge branch 'develop' into standalone_develop
This commit is contained in:
@@ -421,4 +421,19 @@ class Project < ApplicationRecord
|
||||
raise("项目名称包含敏感词汇,请重新输入") if name && !HarmoniousDictionary.clean?(name)
|
||||
raise("项目描述包含敏感词汇,请重新输入") if description && !HarmoniousDictionary.clean?(description)
|
||||
end
|
||||
|
||||
def get_last_project_issues_index
|
||||
last_issue = self.issues.issue_issue.last
|
||||
deleted_issue_count = ($redis_cache.hget("issue_cache_delete_count", self.id) || 0).to_i
|
||||
|
||||
last_issue&.project_issues_index.present? ? last_issue.project_issues_index + deleted_issue_count : 0
|
||||
end
|
||||
|
||||
def incre_project_issue_cache_delete_count(count=1)
|
||||
$redis_cache.hincrby("issue_cache_delete_count", self.id, count)
|
||||
end
|
||||
|
||||
def del_project_issue_cache_delete_count
|
||||
$redis_cache.hdel("issue_cache_delete_count", self.id)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user