feat(admin): deeper order/income filters, post pay-type, topic sales meta

Add order user/payment filters, income/rebate user_id filter, posts list
pay_type dropdown, topic virtual_sales/coupon meta, and forum unlock
facade methods used by hidecontent/payshow.
This commit is contained in:
kate522 committed 2026-07-15 11:35:35 +08:00
1 parent 8d31e65ccd
commit f197745830
11 files changed
+222 -30

No files matched your search

+7 -2
View File
@@ -83,9 +83,9 @@ class AKSRT_Revenue {
}
/**
* Admin list (all users) with optional status filter.
* Admin list (all users) with optional status / user filter.
*
* @param array{status?:string,limit?:int,offset?:int} $args
* @param array{status?:string,user_id?:int,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 {
@@ -94,6 +94,7 @@ class AKSRT_Revenue {
$limit = max(1, min(100, (int) ($args['limit'] ?? 20)));
$offset = max(0, (int) ($args['offset'] ?? 0));
$status = sanitize_key((string) ($args['status'] ?? ''));
$user_id = (int) ($args['user_id'] ?? 0);
$where = [];
$params = [];
@@ -101,6 +102,10 @@ class AKSRT_Revenue {
$where[] = 'status = %s';
$params[] = $status;
}
if ($user_id > 0) {
$where[] = 'user_id = %d';
$params[] = $user_id;
}
$where_sql = $where ? 'WHERE ' . implode(' AND ', $where) : '';
$count_sql = "SELECT COUNT(*) FROM {$this->table()} {$where_sql}";