feat(credits): exchange balance for points

Replace the legacy points-to-balance and external points purchase flows
with direct integer balance-to-points exchange. Enforce exchange and
points-transfer limits and capability checks across the UI and REST API.
This commit is contained in:
kate522 committed 2026-08-13 15:20:06 +08:00
1 parent f9bce15c9a
commit 1247f9bf4e
18 files changed
+234 -648

No files matched your search

+1 -5
View File
@@ -313,9 +313,6 @@ class UserOrders {
if ($type === DomainModel::ORDER_PRODUCT_RECHARGE) {
return __('余额充值', 'aksrt');
}
if ($type === DomainModel::ORDER_PRODUCT_POINTS_BUY) {
return __('购买积分', 'aksrt');
}
if ($product_id > 0) {
$cache_key = (string) $product_id;
if (!array_key_exists($cache_key, $this->post_title_cache)) {
@@ -357,7 +354,7 @@ class UserOrders {
if ($type === DomainModel::ORDER_PRODUCT_VIP) {
$url = function_exists('aksrt_get_user_center_tab_url') ? aksrt_get_user_center_tab_url('vip') : '';
} elseif (in_array($type, [DomainModel::ORDER_PRODUCT_RECHARGE, DomainModel::ORDER_PRODUCT_POINTS_BUY], true)) {
} elseif ($type === DomainModel::ORDER_PRODUCT_RECHARGE) {
$url = function_exists('aksrt_get_user_center_tab_url') ? aksrt_get_user_center_tab_url('credits') : '';
} else {
$url = $post_id > 0 ? get_permalink($post_id) : '';
@@ -371,7 +368,6 @@ class UserOrders {
return match ($type) {
DomainModel::ORDER_PRODUCT_VIP => __('查看会员权益', 'aksrt'),
DomainModel::ORDER_PRODUCT_RECHARGE => __('查看余额', 'aksrt'),
DomainModel::ORDER_PRODUCT_POINTS_BUY => __('查看积分', 'aksrt'),
default => __('打开已购内容', 'aksrt'),
};
}