改进 工单
This commit is contained in:
parent
e1e21b3324
commit
029f000024
@ -15,12 +15,19 @@ class WorkOrderController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*
|
*
|
||||||
|
* @param Request $request
|
||||||
* @param WorkOrder $workOrder
|
* @param WorkOrder $workOrder
|
||||||
* @return View
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function index(WorkOrder $workOrder): View
|
public function index(Request $request, WorkOrder $workOrder): View
|
||||||
{
|
{
|
||||||
$workOrders = $workOrder->with(['user', 'host', 'module'])->latest()->paginate(20)->withQueryString();
|
$workOrders = $workOrder->with(['user', 'host', 'module']);
|
||||||
|
|
||||||
|
if ($request->filled('status')) {
|
||||||
|
$workOrders = $workOrders->where('status', $request->input('status'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$workOrders = $workOrders->latest()->paginate(20)->withQueryString();
|
||||||
|
|
||||||
return view('admin.work-orders.index', compact('workOrders'));
|
return view('admin.work-orders.index', compact('workOrders'));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user