This commit is contained in:
Hankin 2026-07-28 14:59:24 +08:00
parent 13c06c9b37
commit f6ae286a1e
2 changed files with 8 additions and 3 deletions

View File

@ -117,6 +117,10 @@ class OrderController extends Controller
$query->where('agency_id', $agency_id); $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'); $is_export = $request->input('is_export');
if ($is_export) { if ($is_export) {
$orders = $orders->orderByDesc('id')->get(); $orders = $orders->orderByDesc('id')->get();

View File

@ -67,9 +67,10 @@ class OrderController extends Controller
public function schemeOrders(Request $request) public function schemeOrders(Request $request)
{ {
$orders = Order::with("user:id,name,is_privacy")->whereHas("group", function ($sql) { $orderType = $request->input("order_type", 1);
$sql->where("service_type", 1); $orders = Order::with("user:id,name,is_privacy")->whereHas("group", function ($sql) use ($orderType) {
})->paid()->keyword()->scheme()->orderBYDesc('id')->simplePaginate(); $sql->where("service_type", $orderType);
})->where("type_id", $orderType)->paid()->keyword()->scheme()->orderBYDesc('id')->simplePaginate();
return $this->success('ok', $orders); return $this->success('ok', $orders);
} }