From f6ae286a1e0e343048cd9bfcb41c1b0ec31b0f1a Mon Sep 17 00:00:00 2001 From: Hankin Date: Tue, 28 Jul 2026 14:59:24 +0800 Subject: [PATCH] orders --- app/Http/Controllers/Admin/OrderController.php | 4 ++++ app/Http/Controllers/H5/OrderController.php | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Admin/OrderController.php b/app/Http/Controllers/Admin/OrderController.php index 693efb0..3f92c77 100644 --- a/app/Http/Controllers/Admin/OrderController.php +++ b/app/Http/Controllers/Admin/OrderController.php @@ -117,6 +117,10 @@ class OrderController extends Controller $query->where('agency_id', $agency_id); }); } + $orderType = $request->input("order_type", ""); + if ($orderType) { + $orders = $orders->where("type_id", $orderType); + } $is_export = $request->input('is_export'); if ($is_export) { $orders = $orders->orderByDesc('id')->get(); diff --git a/app/Http/Controllers/H5/OrderController.php b/app/Http/Controllers/H5/OrderController.php index d09c43a..a861b26 100644 --- a/app/Http/Controllers/H5/OrderController.php +++ b/app/Http/Controllers/H5/OrderController.php @@ -67,9 +67,10 @@ class OrderController extends Controller public function schemeOrders(Request $request) { - $orders = Order::with("user:id,name,is_privacy")->whereHas("group", function ($sql) { - $sql->where("service_type", 1); - })->paid()->keyword()->scheme()->orderBYDesc('id')->simplePaginate(); + $orderType = $request->input("order_type", 1); + $orders = Order::with("user:id,name,is_privacy")->whereHas("group", function ($sql) use ($orderType) { + $sql->where("service_type", $orderType); + })->where("type_id", $orderType)->paid()->keyword()->scheme()->orderBYDesc('id')->simplePaginate(); return $this->success('ok', $orders); }