更改:负责人排序规则

This commit is contained in:
yystopf 2025-09-04 11:30:46 +08:00
parent 76b70fea14
commit 9942974c42
1 changed files with 2 additions and 1 deletions

View File

@ -106,6 +106,7 @@ class Issue < ApplicationRecord
scope :closed, ->{where(status_id: 5)}
scope :opened, ->{where.not(status_id: 5)}
scope :with_assigner_info, -> {
select("DISTINCT issues.*, u.id AS user_id, CONVERT(COALESCE(u.nickname, u.login) USING gbk) AS user_name").
joins("LEFT JOIN (
SELECT ia.issue_id, ia.assigner_id
FROM issue_assigners ia
@ -120,7 +121,7 @@ class Issue < ApplicationRecord
scope :ordered_by_assigner, -> (sort_direction) {
order("CASE WHEN u.id IS NULL THEN 1 ELSE 0 END ASC")
.order("COALESCE(u.nickname, u.login) #{sort_direction}")
.order("CONVERT(COALESCE(u.nickname, u.login) USING gbk) #{sort_direction}")
}
after_create :incre_project_common, :incre_user_statistic, :incre_platform_statistic
before_save :check_pm_and_update_due_date