From 85f3e7e3d43940135315125bf0c530cd1c0853f1 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 23 Aug 2016 15:51:59 -0700 Subject: [PATCH] Added filter by status type --- app/Http/Controllers/AssetsController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php index 99468dcb3e..8d99d7dbec 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -1588,7 +1588,7 @@ class AssetsController extends Controller * @since [v2.0] * @return String JSON */ - public function getDatatable($status = null) + public function getDatatable(Request $request, $status = null, $status_id = null) { @@ -1640,6 +1640,12 @@ class AssetsController extends Controller } + if ($request->has('status_id')) { + $assets->where('status_id','=', e($request->get('status_id'))); + } + + + $allowed_columns = [ 'id', 'name',