fix(payment): refresh rebate metrics and unify withdrawal statuses

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-06 14:06:28 +08:00
co-authored by Claude Fable 5
parent 99f5c5e834
commit 50236b07fa
6 changed files with 59 additions and 22 deletions
+5 -3
View File
@@ -168,14 +168,16 @@ class PayMenus {
if ($page !== 'aksrt_withdraw' && class_exists('\AKSRT\Payment\Withdrawal')) {
$pending = (int) \AKSRT\Payment\Withdrawal::get_instance()->get_count(['status' => \AKSRT\Payment\Withdrawal::STATUS_PENDING]);
if ($pending > 0) {
$processing = (int) \AKSRT\Payment\Withdrawal::get_instance()->get_count(['status' => \AKSRT\Payment\Withdrawal::STATUS_PROCESSING]);
$active = $pending + $processing;
if ($active > 0) {
$url = admin_url('admin.php?page=aksrt_withdraw&status=pending');
echo '<div class="notice notice-info is-dismissible">';
echo '<h3>' . esc_html__('提现申请待处理', 'aksrt') . '</h3>';
echo '<p>' . esc_html(sprintf(
/* translators: %d: pending withdrawal count */
/* translators: %d: open withdrawal count */
__('您有 %d 个提现申请待处理', 'aksrt'),
$pending
$active
)) . '</p>';
echo '<p><a class="button button-primary" href="' . esc_url($url) . '">' . esc_html__('立即处理', 'aksrt') . '</a></p>';
echo '</div>';
+3 -2
View File
@@ -46,10 +46,12 @@ class PayWithdrawals {
echo '<p>' . esc_html(sprintf(
/* translators: 1: total 2: pending 3: completed 4: paid */
__('共 %1$d 条 · 待处理 %2$d · 已完成 %3$d · 已打款 %4$s', 'aksrt'),
__('共 %1$d 条 · 待处理 %2$d · 处理中 %3$d · 已完成 %4$d · 已拒绝 %5$d · 已打款 %6$s', 'aksrt'),
(int) ($stats['total'] ?? 0),
(int) ($stats['pending'] ?? 0),
(int) ($stats['processing'] ?? 0),
(int) ($stats['completed'] ?? 0),
(int) ($stats['rejected'] ?? 0),
number_format((float) ($stats['total_paid'] ?? 0), 2)
)) . '</p>';
@@ -59,7 +61,6 @@ class PayWithdrawals {
$status_options = [
'' => __('全部状态', 'aksrt'),
'pending' => __('待处理', 'aksrt'),
'approved' => __('已通过', 'aksrt'),
'processing' => __('处理中', 'aksrt'),
'completed' => __('已完成', 'aksrt'),
'rejected' => __('已拒绝', 'aksrt'),