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:
1 parent
8d31e65ccd
commit
f197745830
11 files changed
+222
-30
No files matched your search
@@ -615,11 +615,34 @@ class AKSRT_Order_Repository {
|
||||
$params[] = $product_id;
|
||||
}
|
||||
|
||||
$user_id = (int) ($args['user_id'] ?? 0);
|
||||
if ($user_id > 0) {
|
||||
$where[] = 'user_id = %d';
|
||||
$params[] = $user_id;
|
||||
}
|
||||
|
||||
$payment_method = sanitize_key((string) ($args['payment_method'] ?? ''));
|
||||
if ($payment_method !== '') {
|
||||
$where[] = 'payment_method = %s';
|
||||
$params[] = $payment_method;
|
||||
}
|
||||
|
||||
if ($search !== '') {
|
||||
$where[] = '(order_number LIKE %s OR product_type LIKE %s)';
|
||||
$like = '%' . $wpdb->esc_like($search) . '%';
|
||||
$params[] = $like;
|
||||
$params[] = $like;
|
||||
// Numeric search may mean user_id or product_id; also match order number / type.
|
||||
if (ctype_digit($search)) {
|
||||
$where[] = '(order_number LIKE %s OR product_type LIKE %s OR user_id = %d OR product_id = %d)';
|
||||
$like = '%' . $wpdb->esc_like($search) . '%';
|
||||
$params[] = $like;
|
||||
$params[] = $like;
|
||||
$params[] = (int) $search;
|
||||
$params[] = (int) $search;
|
||||
} else {
|
||||
$where[] = '(order_number LIKE %s OR product_type LIKE %s OR payment_method LIKE %s)';
|
||||
$like = '%' . $wpdb->esc_like($search) . '%';
|
||||
$params[] = $like;
|
||||
$params[] = $like;
|
||||
$params[] = $like;
|
||||
}
|
||||
}
|
||||
|
||||
return [$where, $params];
|
||||
|
||||
Reference in new issue
Block a user