fix: 省份图表"未知"合入"其他"
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
kkfluous
2026-03-29 09:28:03 +08:00
parent e910deac51
commit 6e8e01196c

View File

@@ -1060,9 +1060,10 @@ app.get('/region-chart', async (c) => {
}
}
// 分离"其他",对非"其他"排序取 Top N余全部合入"其他"
const otherCount = counts.get('其他') || 0;
// 分离"其他"和"未知",对剩余排序取 Top N余全部合入"其他"
const otherCount = (counts.get('其他') || 0) + (counts.get('未知') || 0);
counts.delete('其他');
counts.delete('未知');
const sorted = Array.from(counts.entries())
.map(([name, value]) => ({ name, value }))