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
+2 -2
View File
@@ -150,7 +150,7 @@ class PaymentController extends ControllerBase {
$revenue_stats = \AKSRT\Payment\Revenue::get_instance()->get_stats();
}
$withdrawal_stats = ['total' => 0, 'pending' => 0, 'completed' => 0, 'total_paid' => 0];
$withdrawal_stats = ['total' => 0, 'pending' => 0, 'processing' => 0, 'completed' => 0, 'rejected' => 0, 'total_paid' => 0];
if (class_exists('\AKSRT\Payment\Withdrawal')) {
$withdrawal_stats = \AKSRT\Payment\Withdrawal::get_instance()->get_stats();
}
@@ -268,7 +268,7 @@ class PaymentController extends ControllerBase {
$new_status = sanitize_key((string) ($params['status'] ?? ''));
$note = sanitize_textarea_field((string) ($params['note'] ?? ''));
$valid_statuses = ['pending', 'approved', 'processing', 'completed', 'rejected'];
$valid_statuses = ['pending', 'processing', 'completed', 'rejected'];
if (!in_array($new_status, $valid_statuses, true)) {
return $this->error('无效的提现状态');
}