> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 在 Economy（旧版）中获取玩家的至今累计价值 (VTD)

> 使用 GetPlayerProfile 检索 PlayFab 玩家的终身消费，并从 PlayerProfileModel 中读取 totalValueToDateInUSD 和 valuesToDate。

# 获取玩家的至今累计价值 (VTD)（旧版 Economy）

<Info>
  Economy v1 API 处于维护模式，不会接收任何新功能，只有 bug 修复。\*\*v1 API 在可预见的将来将持续维护。\*\*参见 [Economy v2 概览](/services/playfab/economy-monetization/economy-v2/overview)，了解有关 PlayFab Economy 下一版本的更多信息！
</Info>

PlayFab 在[玩家资料模型](xref:titleid.playfabapi.com.client.accountmanagement.getplayerprofile#playerprofilemodel)中跟踪玩家的总消费金额，可通过调用 [GetPlayerProfile](xref:titleid.playfabapi.com.client.accountmanagement.getplayerprofile) API 检索。

在 `PlayerProfileModel` 中，玩家的 VTD 在两个不同的字段中跟踪：

1. `totalValueToDateInUSD` - 玩家使用真实货币进行的购买总和，换算为美元 (**USD**) 等值，并表示为整数分（1/100 USD）。
2. `valuesToDate` - [ValueToDateModel](xref:titleid.playfabapi.com.client.accountmanagement.getplayerprofile#valuetodatemodel) 对象数组，包含玩家的终身购买总额，按他们进行过购买的每种真实货币汇总。每个对象中的 `TotalValue` 字段将该货币的总额表示为 1/100 货币单位的整数。

以下 JSON 显示了带有示例值的这两个字段。

```json theme={null}
{
    …
    totalValueToDateInUSD: 1700
    valuesToDate: [{ "USD", 1200 }, { "EUR", 320 }]
    …
}
```

## 使用 VTD 定义玩家分组

在 PlayFab Game Manager 中，你可以将 totalValueToDateInUSD 或 valuesToDate 用作*分组谓词*——可用于定义玩家分组的条件。

创建或编辑玩家分组时，下拉列表中会包含这两个谓词：

1. **Total value to date in USD** - `TotalValueToDateInUSD` 值。
2. **Value to date** - `ValuesToDate` 总额。当你选择此谓词时，你将看到指定该货币和金额的其他字段。

## 分组示例

以下示例展示了使用每种 VTD 总额创建的分组。

1. 创建一个包含所有以任何货币购买超过 **15 USD** 的玩家的分组。

   <img src="https://mintcdn.com/microsoft-4404708b/Oa_DP1q6U1lat7c2/images/playfab/economy-monetization/economy/tutorials/create-segment-mid-rollers-filter-1.png?fit=max&auto=format&n=Oa_DP1q6U1lat7c2&q=85&s=fa15a6d1b2d3ffbd840f6bb1af492501" alt="Create a Segment - Mid Rollers - Filter 1" width="1280" height="1500" data-path="images/playfab/economy-monetization/economy/tutorials/create-segment-mid-rollers-filter-1.png" />

2. 创建一个包含所有以任何货币花费超过 **15 USD** *或* **15 人民币**的玩家的分组。

   <img src="https://mintcdn.com/microsoft-4404708b/Oa_DP1q6U1lat7c2/images/playfab/economy-monetization/economy/tutorials/create-segment-mid-rollers-filter-2.png?fit=max&auto=format&n=Oa_DP1q6U1lat7c2&q=85&s=2369e1383568c3fe81d6f8def958289e" alt="Create a Segment - Mid Rollers - Filter 2" width="1280" height="1500" data-path="images/playfab/economy-monetization/economy/tutorials/create-segment-mid-rollers-filter-2.png" />


## Related topics

- [物品（旧版 Economy）](/zh-CN/services/playfab/economy-monetization/economy/items/index.md)
- [目录（旧版 Economy）](/zh-CN/services/playfab/economy-monetization/economy/items/catalogs.md)
- [在 Economy（旧版）中管理虚拟货币](/zh-CN/services/playfab/economy-monetization/economy/tutorials/currencies.md)
- [教程：获取玩家个人资料](/zh-CN/services/playfab/player-progression/player-data/getting-player-profiles.md)
- [Economy（旧版）中的定时消耗品](/zh-CN/services/playfab/economy-monetization/economy/tutorials/timed-consumables.md)
