rwadurian/backend/services/admin-service/src
hailin 728728bee3 fix(admin-service): 个人/团队认种数量改为统计棵数而非订单数
【问题】
getUserList 及推荐树节点中「个人认种」「团队认种」显示的是订单条数
(_count: { id }),而非实际认种棵数。一笔订单可认种多棵,导致多棵
合并下单的用户数量严重偏低。

【修复】
将以下方法中的所有 count(orders) 改为 sum(treeCount):
- getPersonalAdoptionCount   — 用户详情页个人认种数
- getTeamStats               — 用户详情页团队认种数
- getBatchUserStats          — 用户列表批量统计(个人/团队/省/市认种数)
- getAncestors               — 推荐树祖先节点认种数
- getDirectReferrals         — 推荐树直推节点认种数

【影响范围】
仅影响 admin-web 管理后台的展示数据,不涉及业务逻辑和数据存储。
省市认种百分比计算基准同步修正(teamAdoptions 也改为棵数),
比例结果不变,但基数更准确。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 22:29:32 -08:00
..
api feat(admin): 引荐关系树节点增加个人/团队预种份数展示 2026-03-02 19:16:02 -08:00
application fix(admin-service): 修复合同服务调用 planting-service 端口和路径错误 2026-02-05 23:20:26 -08:00
authorization fix(admin): 修复授权照片代理未解包全局响应拦截器的问题 2026-03-02 22:50:52 -08:00
config refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
domain feat(admin): 用户预种数量展示 & 授权申请照片查看 2026-03-02 03:09:17 -08:00
infrastructure fix(admin-service): 个人/团队认种数量改为统计棵数而非订单数 2026-03-03 22:29:32 -08:00
pre-planting feat(admin): 用户预种数量展示 & 授权申请照片查看 2026-03-02 03:09:17 -08:00
pricing fix(pricing): 预种定价API常量同步 — 3566→1887, /5→/10, 正式认种15831不变 2026-03-03 01:56:21 -08:00
referral feat(admin): 用户预种数量展示 & 授权申请照片查看 2026-03-02 03:09:17 -08:00
shared/exceptions refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
types refactor(mpc-system): migrate to party-driven architecture with PartyID-based routing 2025-12-05 08:11:28 -08:00
app.module.ts feat(admin): 功能8修正 — 自助申请照片独立展示页(纯新增方案) 2026-03-02 08:08:32 -08:00
main.ts fix(admin-service): exclude /downloads from API prefix 2025-12-09 07:44:53 -08:00