fix(referral): 团队预种总量排除自己的预种份数
TeamStatistics.teamPrePlantingPortions 包含用户自身的预种量, 但"团队预种"应只统计伞下成员。返回时减去 selfPrePlantingPortions。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b59d5bda2d
commit
eb425b0f92
|
|
@ -50,7 +50,7 @@ export class TeamPrePlantingController {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
selfPrePlantingPortions: { type: 'number', description: '个人预种份数' },
|
selfPrePlantingPortions: { type: 'number', description: '个人预种份数' },
|
||||||
teamPrePlantingPortions: { type: 'number', description: '团队预种总量(含自己和所有下级)' },
|
teamPrePlantingPortions: { type: 'number', description: '团队预种总量(不含自己,仅伞下成员)' },
|
||||||
directReferrals: {
|
directReferrals: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
items: {
|
items: {
|
||||||
|
|
@ -123,9 +123,13 @@ export class TeamPrePlantingController {
|
||||||
directReferralStats.sort((a, b) => b.selfPrePlantingPortions - a.selfPrePlantingPortions);
|
directReferralStats.sort((a, b) => b.selfPrePlantingPortions - a.selfPrePlantingPortions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const selfPortions = myStats?.selfPrePlantingPortions ?? 0;
|
||||||
|
const teamPortions = myStats?.teamPrePlantingPortions ?? 0;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
selfPrePlantingPortions: myStats?.selfPrePlantingPortions ?? 0,
|
selfPrePlantingPortions: selfPortions,
|
||||||
teamPrePlantingPortions: myStats?.teamPrePlantingPortions ?? 0,
|
// 团队预种量不含自己,只统计伞下成员
|
||||||
|
teamPrePlantingPortions: teamPortions - selfPortions,
|
||||||
directReferrals: directReferralStats,
|
directReferrals: directReferralStats,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue