From 3bc4597041b20fcdacc36740609abd7052b9e89f Mon Sep 17 00:00:00 2001 From: iven Date: Sat, 2 May 2026 00:21:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(health):=20=E5=B7=A5=E4=BD=9C=E5=8F=B0=20UN?= =?UTF-8?q?ION=20ALL=20=E6=8E=92=E5=BA=8F=20+=20=E5=9B=A2=E9=98=9F?= =?UTF-8?q?=E6=A6=82=E8=A7=88=20display=5Fname=20NULL=20=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - UNION ALL 查询包装子查询解决 PostgreSQL ORDER BY 限制 - get_team_overview 的 display_name 改为 Option 防止 NULL 解码失败 --- crates/erp-health/src/service/action_inbox_service.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/erp-health/src/service/action_inbox_service.rs b/crates/erp-health/src/service/action_inbox_service.rs index 0c36032..b078873 100644 --- a/crates/erp-health/src/service/action_inbox_service.rs +++ b/crates/erp-health/src/service/action_inbox_service.rs @@ -302,7 +302,7 @@ pub async fn list_action_items( let union_sql = segments.join("\n UNION ALL\n"); let data_sql = format!( - r#"{union_sql} + r#"SELECT * FROM ({union_sql}) sub ORDER BY CASE priority_raw WHEN 'high' THEN 1 WHEN 'urgent' THEN 1 WHEN 'medium' THEN 2 ELSE 3 END, created_at DESC @@ -833,7 +833,7 @@ pub async fn get_team_overview( #[derive(Debug, FromQueryResult)] struct MemberRow { user_id: Uuid, - display_name: String, + display_name: Option, title: String, pending_count: i64, completed_count: i64, @@ -875,7 +875,7 @@ pub async fn get_team_overview( }; TeamMemberOverview { user_id: m.user_id, - name: m.display_name, + name: m.display_name.unwrap_or_default(), title: m.title, pending_count: m.pending_count as u64, completed_count: m.completed_count as u64,