fix(health): 工作台 UNION ALL 排序 + 团队概览 display_name NULL 处理
- UNION ALL 查询包装子查询解决 PostgreSQL ORDER BY 限制 - get_team_overview 的 display_name 改为 Option<String> 防止 NULL 解码失败
This commit is contained in:
@@ -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<String>,
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user