feat(payment): separate creator income settlement
This commit is contained in:
+1
-5
@@ -70,12 +70,8 @@ class Center {
|
||||
|
||||
$income_request = [];
|
||||
if ($tab === 'creator') {
|
||||
$currency = sanitize_key((string) $request->get_param('income_currency'));
|
||||
$status = sanitize_key((string) $request->get_param('income_status'));
|
||||
$income_request = [
|
||||
'currency' => in_array($currency, ['', 'CNY', 'points'], true) ? $currency : '',
|
||||
'status' => in_array($status, ['', 'pending', 'settled', 'cancelled', 'reversed', 'pending_recovery'], true) ? $status : '',
|
||||
'page' => max(1, min(100, (int) $request->get_param('income_page'))),
|
||||
'page' => max(1, min(100, (int) $request->get_param('income_page'))),
|
||||
];
|
||||
$context['creator_income_request'] = $income_request;
|
||||
}
|
||||
|
||||
@@ -72,15 +72,25 @@ class CreditsAdmin {
|
||||
}
|
||||
if (class_exists('\AKSRT\Payment\Revenue')) {
|
||||
$stats = \AKSRT\Payment\Revenue::get_instance()->get_stats($user_id);
|
||||
$pending = (float) ($stats['pending'] ?? 0);
|
||||
$total = (float) ($stats['total'] ?? 0);
|
||||
if ($total > 0 || $pending > 0) {
|
||||
$cash = (array) ($stats['cash'] ?? []);
|
||||
$points = (array) ($stats['points'] ?? []);
|
||||
if ((float) ($cash['total'] ?? 0) > 0 || (float) ($cash['pending'] ?? 0) > 0) {
|
||||
$bits[] = sprintf(
|
||||
/* translators: 1 total 2 pending */
|
||||
esc_html__('分成 ¥%1$s(待结 ¥%2$s)', 'aksrt'),
|
||||
number_format($total, 2),
|
||||
number_format($pending, 2)
|
||||
esc_html__('现金分成 ¥%1$s(待结 ¥%2$s)', 'aksrt'),
|
||||
number_format((float) ($cash['total'] ?? 0), 2),
|
||||
number_format((float) ($cash['pending'] ?? 0), 2)
|
||||
);
|
||||
}
|
||||
if ((float) ($points['total'] ?? 0) > 0 || (float) ($points['pending'] ?? 0) > 0) {
|
||||
$bits[] = sprintf(
|
||||
/* translators: 1 total 2 pending */
|
||||
esc_html__('积分分成 %1$s(待结 %2$s)', 'aksrt'),
|
||||
number_format((float) ($points['total'] ?? 0), 0),
|
||||
number_format((float) ($points['pending'] ?? 0), 0)
|
||||
);
|
||||
}
|
||||
if ($bits) {
|
||||
$bits[] = '<a href="' . esc_url(admin_url('admin.php?page=aksrt_income&user_id=' . $user_id)) . '">' . esc_html__('分成明细', 'aksrt') . '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user