feat(users): normalize center routes and withdrawal limits
This commit is contained in:
1 parent
9004f7093f
commit
dacd0095bf
24 files changed
+326
-174
No files matched your search
@@ -32,13 +32,16 @@ $withdraw_on = !empty($all_settings['pay_balance_withdraw_s']);
|
||||
if ($withdraw_on && class_exists('\AKSRT\Settings\Capabilities') && !\AKSRT\Settings\Capabilities::user_can('balance_withdraw', $uid)) {
|
||||
$withdraw_on = false;
|
||||
}
|
||||
$withdraw_min = max(1, (float) ($all_settings['pay_balance_withdraw_lowest_money'] ?? $all_settings['pay_rebate_withdraw_lowest_money'] ?? 50));
|
||||
$withdraw_settings = class_exists('\\AKSRT\\Settings\\Settings') ? \AKSRT\Settings\Settings::get_withdrawal_settings() : [];
|
||||
$withdraw_min = max(0, (float) ($withdraw_settings['min_amount'] ?? 50));
|
||||
$withdraw_usage = ['remaining_count' => 0, 'remaining_amount' => 0];
|
||||
$withdraw_pending_hold = 0.0;
|
||||
$withdraw_history = [];
|
||||
if ($withdraw_on && class_exists('\AKSRT\Payment\Withdrawal')) {
|
||||
$wd_svc = \AKSRT\Payment\Withdrawal::get_instance();
|
||||
$withdraw_pending_hold = $wd_svc->sum_pending_hold((int) ($user_id ?? 0));
|
||||
$withdraw_history = $wd_svc->get_user_withdrawals((int) ($user_id ?? 0), ['limit' => 30]);
|
||||
$withdraw_usage = $wd_svc->daily_usage((int) ($user_id ?? 0), $withdraw_settings);
|
||||
}
|
||||
$withdraw_processing = $withdraw_pending_hold > 0;
|
||||
$card_pass_balance = ['enabled' => false, 'desc' => '', 'only_password' => true];
|
||||
@@ -66,7 +69,7 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元');
|
||||
</div>
|
||||
<?php if ($withdraw_on) : ?>
|
||||
<button type="button" class="uc-asset-card__head-action muted-color px12" data-aksrt-withdraw-history-open>
|
||||
<?php echo $withdraw_processing ? esc_html__('提现处理中', 'aksrt') : esc_html__('提现记录', 'aksrt'); ?>
|
||||
<?php esc_html_e('提现记录', 'aksrt'); ?>
|
||||
<i class="fa fa-angle-right em12 ml3" aria-hidden="true"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
@@ -81,11 +84,7 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元');
|
||||
<button type="button" class="but c-blue-2 mr6 hollow" data-aksrt-transfer-open="balance"><?php esc_html_e('转账', 'aksrt'); ?></button>
|
||||
<?php endif; ?>
|
||||
<?php if ($withdraw_on) : ?>
|
||||
<?php if ($withdraw_processing) : ?>
|
||||
<button type="button" class="but c-blue-2 mr6 hollow" data-aksrt-withdraw-history-open><?php esc_html_e('提现处理中', 'aksrt'); ?></button>
|
||||
<?php else : ?>
|
||||
<button type="button" class="but c-blue-2 mr6 hollow" data-aksrt-withdraw-open><?php esc_html_e('提现', 'aksrt'); ?></button>
|
||||
<?php endif; ?>
|
||||
<button type="button" class="but c-blue-2 mr6 hollow" data-aksrt-withdraw-open><?php esc_html_e('提现', 'aksrt'); ?></button>
|
||||
<?php endif; ?>
|
||||
<button type="button" class="but b-blue-2" data-aksrt-charge-open><?php esc_html_e('充值', 'aksrt'); ?></button>
|
||||
</div>
|
||||
@@ -100,9 +99,8 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元');
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<?php if ($withdraw_on) : ?>
|
||||
<div class="uc-asset-card__foot muted-2-color em09 flex jsb ac mt6">
|
||||
<div class="uc-asset-card__foot muted-2-color em09 mt6">
|
||||
<span><?php printf(esc_html__('处理中冻结 %s', 'aksrt'), esc_html(class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::format((float) $withdraw_pending_hold) : number_format_i18n((float) $withdraw_pending_hold, 2))); ?></span>
|
||||
<button type="button" class="muted-color" data-aksrt-withdraw-history-open><?php esc_html_e('提现记录', 'aksrt'); ?></button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user