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); }