fix(payment): validate creator order type

This commit is contained in:
2026-08-07 13:34:57 +08:00
parent 7cca472fe9
commit e8e39c1ef3
2 changed files with 5 additions and 1 deletions
@@ -18,7 +18,7 @@ if ($creation_url === '' && $revenue_url === '') {
<?php if ($creation_url !== '') : ?>
<a class="uc-center-card uc-center-card--creation" href="<?php echo esc_url($creation_url); ?>">
<span class="uc-center-card__icon"><i class="fas fa-feather-alt" aria-hidden="true"></i></span>
<span><strong><?php esc_html_e('创作中心', 'aksrt'); ?></strong><small><?php esc_html_e('发布与管理内容', 'aksrt'); ?></small></span>
<span><strong><?php esc_html_e('创作中心', 'aksrt'); ?></strong><small><?php esc_html_e('查看作者现金与积分收益', 'aksrt'); ?></small></span>
<i class="fas fa-angle-right" aria-hidden="true"></i>
</a>
<?php endif; ?>
+4
View File
@@ -38,6 +38,10 @@ class Revenue {
if ($order_number === '' || (string) ($order['status'] ?? '') !== 'completed') {
return 0;
}
$product_type = sanitize_key((string) ($order['product_type'] ?? ''));
if ($product_type !== \AKSRT\Core\DomainModel::ORDER_PRODUCT_RESOURCE) {
return 0;
}
$existing = $wpdb->get_var($wpdb->prepare(
"SELECT id FROM {$this->table()} WHERE order_number = %s ORDER BY id ASC LIMIT 1",