From 9942974c42c23ea9ec64e6b72feb064e36d2a422 Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 4 Sep 2025 11:30:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9A=E8=B4=9F=E8=B4=A3?= =?UTF-8?q?=E4=BA=BA=E6=8E=92=E5=BA=8F=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/issue.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index 08c676b00..11f62b92e 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -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