' . esc_html__('请先登录', 'aksrt') . ''; return; } $affiliate = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_payment_affiliate_settings() : []; $withdrawal = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_withdrawal_settings() : []; $all_settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_all() : []; $withdraw_on = !empty($all_settings['pay_balance_withdraw_s']) && class_exists('\AKSRT\Credits\Balance') && \AKSRT\Credits\Balance::enabled(); if ($withdraw_on && class_exists('\AKSRT\Settings\Capabilities') && !\AKSRT\Settings\Capabilities::user_can('balance_withdraw', $user_id)) { $withdraw_on = false; } $withdraw_min = max(1, (float) ($all_settings['pay_balance_withdraw_lowest_money'] ?? $all_settings['pay_rebate_withdraw_lowest_money'] ?? $withdrawal['min_amount'] ?? 50)); $commission_stats = class_exists('\AKSRT\Payment\Rebate') ? \AKSRT\Payment\Rebate::get_instance()->get_stats($user_id) : ['total' => 0, 'pending' => 0, 'pending_amount' => 0, 'settled' => 0, 'total_amount' => 0, 'settled_amount' => 0]; $available_commission = class_exists('\AKSRT\Credits\Balance') ? (float) \AKSRT\Credits\Balance::balance($user_id) : (float) ($commission_stats['settled_amount'] ?? 0); $vip_ratios = is_array($affiliate['user_ratio'] ?? null) ? $affiliate['user_ratio'] : []; $commission_ratio = (int) ($vip_ratios['user'] ?? $affiliate['ratio'] ?? 0); $current_vip = function_exists('aksrt_get_user_vip_level') ? (int) aksrt_get_user_vip_level($user_id) : 0; if ($current_vip >= 2 && !empty($vip_ratios['vip2'])) { $commission_ratio = (int) $vip_ratios['vip2']; } elseif ($current_vip >= 1 && !empty($vip_ratios['vip1'])) { $commission_ratio = (int) $vip_ratios['vip1']; } $details_text = trim((string) ($affiliate['text']['details'] ?? '')); if ($details_text === '') { $details_text = trim((string) ($affiliate['note'] ?? '')) ?: __('好友通过推广链接完成符合条件的订单后,系统会按当前佣金比例记录返佣,结算后进入可提现余额。', 'aksrt'); } $revenue_request = is_array($context['revenue_request'] ?? null) ? $context['revenue_request'] : []; $active_reward_tab = sanitize_key((string) ($revenue_request['reward_tab'] ?? ($_GET['reward_tab'] ?? 'detail'))); if (!in_array($active_reward_tab, ['detail', 'orders', 'users'], true)) { $active_reward_tab = 'detail'; } $base_url = function_exists('aksrt_get_user_center_tab_url') ? aksrt_get_user_center_tab_url('revenue') : home_url('/profile/?tab=revenue'); $reward_url = static function (string $tab, array $extra = []) use ($base_url): string { return add_query_arg(array_merge(['reward_tab' => $tab], $extra), $base_url); }; $format_amount = static function ($amount): string { return number_format_i18n((float) $amount, 2); }; $commission_page = max(1, (int) ($revenue_request['commission_page'] ?? ($_GET['commission_page'] ?? 1))); $commission_view = class_exists('\AKSRT\Payment\Rebate') ? \AKSRT\Payment\Rebate::get_instance()->get_list([ 'user_id' => $user_id, 'limit' => 10, 'offset' => ($commission_page - 1) * 10, ]) : ['items' => [], 'total' => 0, 'max_pages' => 1, 'page' => 1]; $commission_items = (array) ($commission_view['items'] ?? []); $commission_total_pages = max(1, (int) ($commission_view['max_pages'] ?? ceil(max(1, (int) ($commission_view['total'] ?? 0)) / 10))); if ($commission_page > $commission_total_pages) { $commission_page = $commission_total_pages; if (class_exists('\AKSRT\Payment\Rebate')) { $commission_view = \AKSRT\Payment\Rebate::get_instance()->get_list([ 'user_id' => $user_id, 'limit' => 10, 'offset' => ($commission_page - 1) * 10, ]); } } $commission_items = (array) ($commission_view['items'] ?? []); $status_labels = [ 'pending' => __('待结算', 'aksrt'), 'settled' => __('已结算', 'aksrt'), 'cancelled' => __('已取消', 'aksrt'), ]; ?>
%

--

%
VIP 1
%
VIP 2
%

display_name : __('推广用户', 'aksrt'); ?>
+
1) : ?>