Zuncle
ddd66bf4e9
fix(dashboard): 修复盈亏分析商品产出只统计待发货库存的bug
问题:
盈亏分析(GetUserProfitLossTrend)和用户画像(GetUserProfile)中的
"商品产出"查询条件为 `ui.status = 1`,只统计了待发货/库存中的商品,
已发货/已兑换(status=3)的商品被完全排除。
示例:用户9110实际累计获得874件商品(价值¥16,279.40),但因为大部分
已发货(status=3),盈亏分析只显示商品产出¥12.50,全资产产出严重偏低。
而 dashboard_user_spending.go 中的同类查询正确使用了
`status IN (1, 3)`,说明此处是遗漏。
修复:
- users_profit_loss.go: 当前资产快照查询改为 `status IN (1, 3)`
- users_profile.go: 库存统计查询改为 `status IN (1, 3)`
- 与 dashboard_user_spending.go 的计算口径对齐
2026-03-20 20:39:50 +08:00
..
2026-03-16 21:41:39 +08:00
2026-03-20 20:39:50 +08:00
2026-03-18 21:58:25 +08:00
2026-02-21 21:33:19 +08:00
2026-02-21 21:33:19 +08:00
2026-02-21 21:33:19 +08:00
2026-02-21 21:33:19 +08:00
2026-02-21 21:33:19 +08:00
2026-03-05 12:50:06 +08:00
2026-03-20 00:57:17 +08:00