feat(admin): complete native pay ops lists and users.php governance menus

Phase 2b fills shipping, after-sale, coupons, income, and rebate PHP admin
pages under 支付中心, reusing domain services. Phase 3 adds zibll-style
users.php submenus for messages, invite codes, identity verify, and
report/ban queues with admin notices for pending work.
This commit is contained in:
kate522 committed 2026-07-15 02:00:42 +08:00
1 parent ebe3e188e1
commit bf061f43ee
6 files changed
+1290 -64

No files matched your search

+39
View File
@@ -82,6 +82,45 @@ class AKSRT_Revenue {
return (array) $wpdb->get_results($wpdb->prepare($sql, $params), ARRAY_A);
}
/**
* Admin list (all users) with optional status filter.
*
* @param array{status?:string,limit?:int,offset?:int} $args
* @return array{items:array<int,array>,total:int,page:int,max_pages:int}
*/
public function get_list(array $args = []): array {
global $wpdb;
$limit = max(1, min(100, (int) ($args['limit'] ?? 20)));
$offset = max(0, (int) ($args['offset'] ?? 0));
$status = sanitize_key((string) ($args['status'] ?? ''));
$where = [];
$params = [];
if ($status !== '') {
$where[] = 'status = %s';
$params[] = $status;
}
$where_sql = $where ? 'WHERE ' . implode(' AND ', $where) : '';
$count_sql = "SELECT COUNT(*) FROM {$this->table()} {$where_sql}";
$total = $params
? (int) $wpdb->get_var($wpdb->prepare($count_sql, $params))
: (int) $wpdb->get_var($count_sql);
$sql = "SELECT * FROM {$this->table()} {$where_sql} ORDER BY created_at DESC LIMIT %d OFFSET %d";
$params[] = $limit;
$params[] = $offset;
$items = $wpdb->get_results($wpdb->prepare($sql, $params), ARRAY_A);
return [
'items' => $items ?: [],
'total' => $total,
'page' => (int) floor($offset / $limit) + 1,
'max_pages' => (int) ceil(max(1, $total) / $limit),
];
}
/**
* 获取收益统计
*/