diff --git a/app/Http/Controllers/Api/ReportsController.php b/app/Http/Controllers/Api/ReportsController.php index 566911dd27..63fca39d19 100644 --- a/app/Http/Controllers/Api/ReportsController.php +++ b/app/Http/Controllers/Api/ReportsController.php @@ -44,21 +44,6 @@ class ReportsController extends Controller }); } - if ($request->filled('action_type')) { - $actionlogs = $actionlogs->where('action_type', '=', $request->input('action_type'))->orderBy('created_at', 'desc'); - } - - if ($request->filled('created_by')) { - $actionlogs = $actionlogs->where('created_by', '=', $request->input('created_by')); - } - - if ($request->filled('action_source')) { - $actionlogs = $actionlogs->where('action_source', '=', $request->input('action_source'))->orderBy('created_at', 'desc'); - } - - if ($request->filled('remote_ip')) { - $actionlogs = $actionlogs->where('remote_ip', '=', $request->input('remote_ip'))->orderBy('created_at', 'desc'); - } if ($request->filled('uploads')) { $actionlogs = $actionlogs->whereNotNull('filename')->orderBy('created_at', 'desc'); @@ -74,6 +59,8 @@ class ReportsController extends Controller 'note', 'remote_ip', 'user_agent', + 'target_type', + 'item_type', 'action_source', 'action_date', ]; diff --git a/app/Models/Actionlog.php b/app/Models/Actionlog.php index 0831352b87..008c5b1146 100755 --- a/app/Models/Actionlog.php +++ b/app/Models/Actionlog.php @@ -55,6 +55,8 @@ class Actionlog extends SnipeModel 'created_by', 'remote_ip', 'user_agent', + 'item_type', + 'target_type', 'action_source' ]; @@ -64,10 +66,10 @@ class Actionlog extends SnipeModel * @var array */ protected $searchableRelations = [ - 'company' => ['name'], - 'adminuser' => ['first_name','last_name','username', 'email'], - 'user' => ['first_name','last_name','username', 'email'], - 'assets' => ['asset_tag','name'], + 'company' => ['name'], + 'adminuser' => ['first_name','last_name','username', 'email'], + 'user' => ['first_name','last_name','username', 'email'], + 'assets' => ['asset_tag','name'], ]; /** diff --git a/resources/views/reports/activity.blade.php b/resources/views/reports/activity.blade.php index 178446a785..d2e0107649 100644 --- a/resources/views/reports/activity.blade.php +++ b/resources/views/reports/activity.blade.php @@ -64,7 +64,7 @@