feat(user-center): merge promotion rewards into revenue

This commit is contained in:
2026-08-05 23:43:16 +08:00
parent a87fd32fa3
commit 39c92017d9
14 changed files with 1048 additions and 159 deletions
+6 -7
View File
@@ -104,7 +104,7 @@ if (!function_exists('aksrt_get_user_center_tab_url')) {
function aksrt_get_user_center_tab_url(string $tab): string {
$tab = sanitize_key($tab);
if ('invite' === $tab || 'promotion' === $tab) {
$tab = 'promotion';
$tab = 'revenue';
}
$url = remove_query_arg([
'tab', 'posts_page', 'comments_page', 'favorites_page', 'credits_page',
@@ -154,7 +154,6 @@ if (!function_exists('aksrt_capture_user_center_view')) {
'vip' => 'vip',
'orders' => 'orders',
'auth' => 'auth',
'promotion' => 'promotion',
'revenue' => 'revenue',
'settings' => 'settings',
'header' => 'header',
@@ -180,7 +179,7 @@ if (!function_exists('aksrt_capture_user_center_panel')) {
* Capture a built-in or registered user-center panel body.
*/
function aksrt_capture_user_center_panel(string $tab_key, array $tab, array $context): string {
$built_in_tabs = ['profile', 'level', 'posts', 'comments', 'favorites', 'credits', 'vip', 'orders', 'auth', 'promotion', 'revenue', 'settings'];
$built_in_tabs = ['profile', 'level', 'posts', 'comments', 'favorites', 'credits', 'vip', 'orders', 'auth', 'revenue', 'settings'];
if (in_array($tab_key, $built_in_tabs, true)) {
return aksrt_capture_user_center_view($tab_key, $context);
}
@@ -288,7 +287,7 @@ if (!function_exists('aksrt_user_center_resolve_tabs')) {
if ('signin' === $active || 'assets' === $active) {
$active = 'credits';
} elseif ('invite' === $active || 'promotion' === $active) {
$active = 'promotion';
$active = 'revenue';
} elseif ('vip' === $active) {
// Prefer dedicated vip tab when registered; else credits (VIP shop).
$active = in_array('vip', $keys, true) ? 'vip' : 'credits';
@@ -347,9 +346,9 @@ if (!function_exists('aksrt_user_center_runtime_config')) {
'activeTab' => $active_tab,
'tabAliases' => [
'signin' => 'credits',
'invite' => 'promotion',
'promotion' => 'promotion',
'assets' => 'credits',
'invite' => 'revenue',
'promotion' => 'revenue',
'assets' => 'credits',
// vip → vip when panel exists; SPA may still map missing keys via server resolve.
'vip' => 'vip',
],