对小工具进行了一些修复

This commit is contained in:
2026-08-26 11:17:22 +08:00
parent 523af723ae
commit 9ad6f41592
9 changed files with 17 additions and 223 deletions
+2 -5
View File
@@ -32,7 +32,7 @@ final class PostQuery {
// The modern tab widget uses Zibll's signed `cat` syntax. Legacy
// category_ids remains available only to the unrelated generic posts
// widgets; a tab segment must never fall back to it.
$is_reference_segment = array_key_exists('cat', $segment) || array_key_exists('topics', $segment) || array_key_exists('zibpay_type', $segment);
$is_reference_segment = array_key_exists('cat', $segment) || array_key_exists('topics', $segment);
$cat_raw = array_key_exists('cat', $config) ? (string) $config['cat'] : ($is_reference_segment ? '' : (string) ($config['category_ids'] ?? ''));
$categories = self::signed_ids($cat_raw);
if (!empty($config['category_id'])) $categories = [(int) $config['category_id']];
@@ -65,7 +65,7 @@ final class PostQuery {
$args['date_query'] = [['after' => $format($now - ($days * DAY_IN_SECONDS)), 'before' => $format($now), 'inclusive' => true]];
}
self::apply_order($args, (string) ($config['orderby'] ?? 'date'), (string) ($config['order'] ?? 'DESC'));
$pay = array_key_exists('zibpay_type', $config) ? $config['zibpay_type'] : ($is_reference_segment ? '' : ($config['pay_type'] ?? ''));
$pay = $is_reference_segment ? '' : ($config['pay_type'] ?? '');
self::apply_pay_type($args, $pay);
return $args;
}
@@ -94,9 +94,6 @@ final class PostQuery {
'like' => '_aksrt_like_count', 'likes' => '_aksrt_like_count',
'favorite' => '_aksrt_favorite_count', 'favorites' => '_aksrt_favorite_count',
'downloads' => class_exists('AKSRT\\Core\\DomainModel') ? \AKSRT\Core\DomainModel::RESOURCE_DOWNLOAD_COUNT_KEY : '_aksrt_res_download_count',
'zibpay_price' => class_exists('AKSRT\\Core\\DomainModel') ? \AKSRT\Core\DomainModel::PAY_PRICE_KEY : '_aksrt_pay_price',
'zibpay_points_price' => '_aksrt_pay_points_price',
'sales_volume' => class_exists('AKSRT\\Core\\DomainModel') ? \AKSRT\Core\DomainModel::RESOURCE_SALES_VOLUME_KEY : '_aksrt_sales_volume',
];
if (isset($meta[$orderby])) {
$args['meta_key'] = $meta[$orderby];