fix: correct commission amount display
This commit is contained in:
@@ -27,16 +27,11 @@ if ($withdraw_on && class_exists('\AKSRT\Settings\Capabilities') && !\AKSRT\Sett
|
||||
$withdraw_on = false;
|
||||
}
|
||||
$withdraw_min = max(1, (float) ($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);
|
||||
$pending_commission = (float) ($commission_stats['pending'] ?? 0);
|
||||
$vip_ratios = [];
|
||||
$commission_ratio = class_exists('\AKSRT\Settings\Settings')
|
||||
? (float) \AKSRT\Settings\Settings::affiliate_ratio_for_user($user_id)
|
||||
@@ -107,8 +102,8 @@ $status_labels = [
|
||||
<article class="uc-commission-card uc-commission-card--balance">
|
||||
<div class="uc-commission-card__body">
|
||||
<span><?php esc_html_e('我的佣金', 'aksrt'); ?></span>
|
||||
<strong><small>¥</small><?php echo esc_html($format_amount($available_commission)); ?></strong>
|
||||
<span><?php printf(esc_html__('累计¥%s · 待结算¥%s', 'aksrt'), esc_html($format_amount($commission_stats['total'] ?? 0)), esc_html($format_amount($commission_stats['pending'] ?? 0))); ?></span>
|
||||
<strong><small>¥</small><?php echo esc_html($format_amount($pending_commission)); ?></strong>
|
||||
<span><?php printf(esc_html__('累计佣金 ¥%s', 'aksrt'), esc_html($format_amount($commission_stats['total'] ?? 0))); ?></span>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user