Exclude transfer red packets from expense pie chart and breakdown

This commit is contained in:
2026-05-06 02:07:36 +08:00
parent 1598455f5f
commit f357fba2a5
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ const COLORS = [
]; ];
// 不参与支出饼图的分类 // 不参与支出饼图的分类
const EXCLUDED_CATEGORIES = ["投资理财"]; const EXCLUDED_CATEGORIES = ["投资理财", "转账红包"];
export default function Dashboard() { export default function Dashboard() {
const [overview, setOverview] = useState(null); const [overview, setOverview] = useState(null);
+5 -5
View File
@@ -38,8 +38,8 @@ router.get("/overview", (req, res) => {
// 按分类统计支出(用于饼图) // 按分类统计支出(用于饼图)
const catWhere = where const catWhere = where
? where + " AND d.direction = 'expense' AND d.category IS NOT NULL" ? where + " AND d.direction = 'expense' AND d.category IS NOT NULL AND d.category NOT IN ('投资理财','转账红包')"
: "WHERE d.direction = 'expense' AND d.category IS NOT NULL"; : "WHERE d.direction = 'expense' AND d.category IS NOT NULL AND d.category NOT IN ('投资理财','转账红包')";
const categoryStats = db const categoryStats = db
.prepare( .prepare(
@@ -57,10 +57,10 @@ router.get("/overview", (req, res) => {
) )
.all(...params); .all(...params);
// 按分类汇总(收入+支出),排除投资理财 // 按分类汇总(收入+支出),排除投资理财、转账红包
const catBreakWhere = where const catBreakWhere = where
? where + " AND d.category IS NOT NULL AND d.category != '投资理财'" ? where + " AND d.category IS NOT NULL AND d.category NOT IN ('投资理财','转账红包')"
: "WHERE d.category IS NOT NULL AND d.category != '投资理财'"; : "WHERE d.category IS NOT NULL AND d.category NOT IN ('投资理财','转账红包')";
const categoryBreakdown = db const categoryBreakdown = db
.prepare( .prepare(