' . 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() : []; $withdraw_on = !empty($affiliate['enabled']) && 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) ($affiliate['min_withdrawal'] ?? $withdrawal['min_amount'] ?? 50)); $wallet_fmt = class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::format((float) \AKSRT\Credits\Balance::balance($user_id)) : '0.00'; $commission_stats = class_exists('\AKSRT\Payment\CommissionLedger') ? \AKSRT\Payment\CommissionLedger::get_instance()->overview($user_id) : ['total' => 0, 'pending' => 0, 'settled' => 0, 'wallet' => 0]; $available_commission = class_exists('\AKSRT\Credits\Balance') ? (float) \AKSRT\Credits\Balance::balance($user_id) : (float) ($commission_stats['settled'] ?? 0); $vip_ratios = []; $commission_ratio = (float) ($affiliate['ratio'] ?? 0); $details_text = trim((string) ($affiliate['promotion_text'] ?? '')); if ($details_text === '') { $details_text = __('好友通过推广链接完成符合条件的订单后,系统会按当前佣金比例记录返佣,结算后进入可提现余额。', '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('promotion') : home_url('/user/promotion/'); $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\CommissionLedger') ? \AKSRT\Payment\CommissionLedger::get_instance()->list_entries($user_id, [ 'per_page' => 10, 'page' => $commission_page, ]) : ['items' => [], 'total' => 0, 'max_pages' => 1, 'page' => 1]; $commission_items = (array) ($commission_view['items'] ?? []); $user_page = max(1, (int) ($_GET['user_page'] ?? 1)); $user_view = class_exists('\AKSRT\Payment\ReferralAttribution') ? \AKSRT\Payment\ReferralAttribution::get_instance()->list_referred_users($user_id, $user_page, 10) : ['items' => [], 'total' => 0, 'max_pages' => 1, 'page' => 1]; $user_total_pages = max(1, (int) ($user_view['max_pages'] ?? 1)); if ($user_page > $user_total_pages && class_exists('\AKSRT\Payment\ReferralAttribution')) { $user_page = $user_total_pages; $user_view = \AKSRT\Payment\ReferralAttribution::get_instance()->list_referred_users($user_id, $user_page, 10); } $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\CommissionLedger')) { $commission_view = \AKSRT\Payment\CommissionLedger::get_instance()->list_entries($user_id, [ 'per_page' => 10, 'page' => $commission_page, ]); } } $commission_items = (array) ($commission_view['items'] ?? []); $status_labels = [ 'pending' => __('待结算', 'aksrt'), 'settled' => __('已结算', 'aksrt'), 'cancelled' => __('已取消', 'aksrt'), ]; ?>
%

0 ? esc_html__('普通用户推广订单返佣比例', 'aksrt') : esc_html__('暂未参与', 'aksrt'); ?>

¥

%
—
累计元已提现元

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

1) : ?>