Removed duplicate code

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-09-19 17:25:09 +01:00
parent 65eba30038
commit 5c3180ffa0

View file

@ -48,6 +48,10 @@ class AssetMaintenancesController extends Controller
$maintenances->where('asset_maintenances.supplier_id', '=', $request->input('supplier_id'));
}
if ($request->filled('created_by')) {
$maintenances->where('asset_maintenances.created_by', '=', $request->input('created_by'));
}
if ($request->filled('asset_maintenance_type')) {
$maintenances->where('asset_maintenance_type', '=', $request->input('asset_maintenance_type'));
}
@ -97,9 +101,6 @@ class AssetMaintenancesController extends Controller
case 'status_label':
$maintenances = $maintenances->OrderStatusName($order);
break;
case 'created_by':
$maintenances = $maintenances->OrderByCreatedBy($order);
break;
default:
$maintenances = $maintenances->orderBy($sort, $order);
break;