feat(payment): separate creator income settlement
This commit is contained in:
@@ -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