forked from Trustie/forgeplus
更改:负责人排序规则
This commit is contained in:
parent
76b70fea14
commit
9942974c42
|
|
@ -106,6 +106,7 @@ class Issue < ApplicationRecord
|
||||||
scope :closed, ->{where(status_id: 5)}
|
scope :closed, ->{where(status_id: 5)}
|
||||||
scope :opened, ->{where.not(status_id: 5)}
|
scope :opened, ->{where.not(status_id: 5)}
|
||||||
scope :with_assigner_info, -> {
|
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 (
|
joins("LEFT JOIN (
|
||||||
SELECT ia.issue_id, ia.assigner_id
|
SELECT ia.issue_id, ia.assigner_id
|
||||||
FROM issue_assigners ia
|
FROM issue_assigners ia
|
||||||
|
|
@ -120,7 +121,7 @@ class Issue < ApplicationRecord
|
||||||
|
|
||||||
scope :ordered_by_assigner, -> (sort_direction) {
|
scope :ordered_by_assigner, -> (sort_direction) {
|
||||||
order("CASE WHEN u.id IS NULL THEN 1 ELSE 0 END ASC")
|
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
|
after_create :incre_project_common, :incre_user_statistic, :incre_platform_statistic
|
||||||
before_save :check_pm_and_update_due_date
|
before_save :check_pm_and_update_due_date
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue