From 33b45898b177a49155949516beddab3847ff6f9d Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 25 Oct 2023 12:59:58 -0700 Subject: [PATCH 1/3] adds to advancedsearch --- app/Models/Asset.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 7bce0df242..0479e40df6 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -950,6 +950,7 @@ class Asset extends Depreciable ->orWhere('assets_users.first_name', 'LIKE', '%'.$term.'%') ->orWhere('assets_users.last_name', 'LIKE', '%'.$term.'%') ->orWhere('assets_users.username', 'LIKE', '%'.$term.'%') + ->orWhere('assets_users.employee_num', 'LIKE', '%'.$term.'%') ->orWhereMultipleColumns([ 'assets_users.first_name', 'assets_users.last_name', @@ -1359,7 +1360,8 @@ class Asset extends Depreciable ->orWhere('assets.asset_tag', 'LIKE', '%'.$search.'%') ->orWhere('assets.serial', 'LIKE', '%'.$search.'%') ->orWhere('assets.order_number', 'LIKE', '%'.$search.'%') - ->orWhere('assets.notes', 'LIKE', '%'.$search.'%'); + ->orWhere('assets.notes', 'LIKE', '%'.$search.'%') + ->orWhere('assets_users.employee_num', 'LIKE', '%'.$search.'%'); } })->withTrashed()->whereNull('assets.deleted_at'); //workaround for laravel bug From 56fd41eee424175d7c90842d3fc25ebae24a2df8 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 25 Oct 2023 13:03:12 -0700 Subject: [PATCH 2/3] removed erroneous code --- app/Models/Asset.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 0479e40df6..83522d3862 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -1361,7 +1361,6 @@ class Asset extends Depreciable ->orWhere('assets.serial', 'LIKE', '%'.$search.'%') ->orWhere('assets.order_number', 'LIKE', '%'.$search.'%') ->orWhere('assets.notes', 'LIKE', '%'.$search.'%') - ->orWhere('assets_users.employee_num', 'LIKE', '%'.$search.'%'); } })->withTrashed()->whereNull('assets.deleted_at'); //workaround for laravel bug From 1b614c13fb69856b4b55e74a6e99e28ed22200bf Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 25 Oct 2023 13:03:42 -0700 Subject: [PATCH 3/3] ugh --- app/Models/Asset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 83522d3862..2b055c196e 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -1360,7 +1360,7 @@ class Asset extends Depreciable ->orWhere('assets.asset_tag', 'LIKE', '%'.$search.'%') ->orWhere('assets.serial', 'LIKE', '%'.$search.'%') ->orWhere('assets.order_number', 'LIKE', '%'.$search.'%') - ->orWhere('assets.notes', 'LIKE', '%'.$search.'%') + ->orWhere('assets.notes', 'LIKE', '%'.$search.'%'); } })->withTrashed()->whereNull('assets.deleted_at'); //workaround for laravel bug