改进 排序
This commit is contained in:
parent
0ae44a85cb
commit
b28ae8af8f
@ -22,6 +22,11 @@ public function index(WorkOrder $workOrder): View
|
|||||||
{
|
{
|
||||||
$workOrders = $workOrder->with(['user', 'host', 'module'])->latest()->paginate(20)->withQueryString();
|
$workOrders = $workOrder->with(['user', 'host', 'module'])->latest()->paginate(20)->withQueryString();
|
||||||
|
|
||||||
|
// 根据 status 排序, closed 的在后面
|
||||||
|
$workOrders = $workOrders->sortBy(function ($workOrder) {
|
||||||
|
return $workOrder->status === 'closed';
|
||||||
|
});
|
||||||
|
|
||||||
return view('admin.work-orders.index', compact('workOrders'));
|
return view('admin.work-orders.index', compact('workOrders'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user