From eb425b0f92ca932110383c3985d61c0ee7824f70 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 2 Mar 2026 19:03:08 -0800 Subject: [PATCH] =?UTF-8?q?fix(referral):=20=E5=9B=A2=E9=98=9F=E9=A2=84?= =?UTF-8?q?=E7=A7=8D=E6=80=BB=E9=87=8F=E6=8E=92=E9=99=A4=E8=87=AA=E5=B7=B1?= =?UTF-8?q?=E7=9A=84=E9=A2=84=E7=A7=8D=E4=BB=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TeamStatistics.teamPrePlantingPortions 包含用户自身的预种量, 但"团队预种"应只统计伞下成员。返回时减去 selfPrePlantingPortions。 Co-Authored-By: Claude Opus 4.6 --- .../api/controllers/team-pre-planting.controller.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/services/referral-service/src/api/controllers/team-pre-planting.controller.ts b/backend/services/referral-service/src/api/controllers/team-pre-planting.controller.ts index ccbc2a71..d29349ca 100644 --- a/backend/services/referral-service/src/api/controllers/team-pre-planting.controller.ts +++ b/backend/services/referral-service/src/api/controllers/team-pre-planting.controller.ts @@ -50,7 +50,7 @@ export class TeamPrePlantingController { type: 'object', properties: { selfPrePlantingPortions: { type: 'number', description: '个人预种份数' }, - teamPrePlantingPortions: { type: 'number', description: '团队预种总量(含自己和所有下级)' }, + teamPrePlantingPortions: { type: 'number', description: '团队预种总量(不含自己,仅伞下成员)' }, directReferrals: { type: 'array', items: { @@ -123,9 +123,13 @@ export class TeamPrePlantingController { directReferralStats.sort((a, b) => b.selfPrePlantingPortions - a.selfPrePlantingPortions); } + const selfPortions = myStats?.selfPrePlantingPortions ?? 0; + const teamPortions = myStats?.teamPrePlantingPortions ?? 0; + return { - selfPrePlantingPortions: myStats?.selfPrePlantingPortions ?? 0, - teamPrePlantingPortions: myStats?.teamPrePlantingPortions ?? 0, + selfPrePlantingPortions: selfPortions, + // 团队预种量不含自己,只统计伞下成员 + teamPrePlantingPortions: teamPortions - selfPortions, directReferrals: directReferralStats, }; }