feat(orders): full-chain My Orders for all product types

Unify front-end order center across shop, content, VIP, recharge,
points, and plate-follow with type filters, stats, and type-aware
cards; keep shop-only fulfillment actions; ensure 权益与消费 entry URL.
This commit is contained in:
kate522 committed 2026-07-25 13:33:43 +08:00
1 parent 85ade059a2
commit 3baa8573c9
8 files changed
+841 -152

No files matched your search

+30 -13
View File
@@ -52,21 +52,38 @@ function aksrt_get_cart_page_view(int $user_id): array {
return \AKSRT\Shop\Shop::get_instance()->get_cart_page_view($user_id);
}
function aksrt_get_orders_page_view(int $user_id, int $paged = 1, int $per_page = 20, string $status = ''): array {
if ($user_id <= 0 || !class_exists('\AKSRT\Shop\Shop')) {
return [
'items' => [],
'total' => 0,
'total_pages' => 1,
'page' => 1,
];
function aksrt_get_orders_page_view(int $user_id, int $paged = 1, int $per_page = 20, string $status = '', string $product_type = ''): array {
$empty = [
'items' => [],
'total' => 0,
'total_pages' => 1,
'page' => 1,
'stats' => ['total' => 0, 'pending' => 0, 'paid' => 0],
'product_types' => class_exists('\AKSRT\Core\DomainModel')
? array_merge(['' => __('全部类型', 'aksrt')], \AKSRT\Core\DomainModel::order_product_type_labels())
: [],
];
if ($user_id <= 0) {
return $empty;
}
return \AKSRT\Shop\Shop::get_instance()->get_order_center_view($user_id, [
'page' => $paged,
'per_page' => $per_page,
'status' => $status,
]);
$args = [
'page' => $paged,
'per_page' => $per_page,
'status' => $status,
'product_type' => $product_type,
];
if (class_exists('\AKSRT\Payment\UserOrders')) {
return \AKSRT\Payment\UserOrders::get_instance()->get_order_center_view($user_id, $args);
}
if (class_exists('\AKSRT\Shop\Shop')) {
return \AKSRT\Shop\Shop::get_instance()->get_order_center_view($user_id, $args);
}
return $empty;
}
function aksrt_get_revenue_page_view(int $user_id): array {