feat(users): merge promotion into revenue center

This commit is contained in:
2026-08-03 15:38:17 +08:00
parent 156060d2ec
commit 49c12b761f
20 changed files with 369 additions and 413 deletions
+13 -7
View File
@@ -91,9 +91,9 @@ class Center {
'priority' => 50,
'type' => 'panel',
],
'promotion' => [
'label' => __('推广中心', 'aksrt'),
'icon' => 'user-plus',
'revenue' => [
'label' => __('收益中心', 'aksrt'),
'icon' => 'chart-line',
'priority' => 55,
'type' => 'panel',
],
@@ -127,10 +127,16 @@ class Center {
&& !empty(\AKSRT\User\Level::settings()['enabled']);
$credits_on = class_exists('\AKSRT\Settings\Settings') && \AKSRT\Settings\Settings::credits_enabled();
$balance_on = class_exists('\AKSRT\Credits\Balance') && \AKSRT\Credits\Balance::enabled();
$promotion_on = $credits_on
$invite_on = $credits_on
&& class_exists('\AKSRT\Settings\Settings')
&& \AKSRT\Settings\Settings::invite_enabled()
&& \AKSRT\Settings\Settings::invite_registration_enabled();
$revenue_on = class_exists('\AKSRT\Settings\Settings')
&& (
!empty(\AKSRT\Settings\Settings::get_payment_revenue_settings()['enabled'])
|| !empty(\AKSRT\Settings\Settings::get_payment_affiliate_settings()['enabled'])
);
$revenue_tab_on = $revenue_on || $invite_on;
$vip_on = class_exists('\AKSRT\Settings\Settings')
&& !empty(\AKSRT\Settings\Settings::get_payment_vip_settings()['enabled']);
@@ -177,7 +183,7 @@ class Center {
if (($credits_on || $balance_on) && !in_array('credits', $order, true)) {
$order[] = 'credits';
}
if ($promotion_on && !in_array('promotion', $order, true)) {
if ($revenue_tab_on && !in_array('revenue', $order, true)) {
$insert_at = count($order);
foreach (['credits', 'favorites', 'posts'] as $anchor) {
$idx = array_search($anchor, $order, true);
@@ -186,7 +192,7 @@ class Center {
break;
}
}
array_splice($order, $insert_at, 0, ['promotion']);
array_splice($order, $insert_at, 0, ['revenue']);
}
$auth_on = class_exists('\AKSRT\User\AuthApply')
&& !empty(\AKSRT\User\AuthApply::settings()['enabled']);
@@ -207,7 +213,7 @@ class Center {
if ($key === 'credits' && !$credits_on && !$balance_on) {
continue;
}
if ($key === 'promotion' && !$promotion_on) {
if ($key === 'revenue' && !$revenue_tab_on) {
continue;
}
if ($key === 'vip' && !$vip_on) {