Merge pull request #13483 from inietov/fixes/default_locations_advanced_search

Fixed #13359 Advanced search by Default Location does not work
This commit is contained in:
snipe 2023-08-17 15:15:21 +01:00 committed by GitHub
commit 03a01c02c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1433,6 +1433,12 @@ class Asset extends Depreciable
});
}
if ($fieldname == 'rtd_location') {
$query->whereHas('defaultLoc', function ($query) use ($search_val) {
$query->where('locations.name', 'LIKE', '%'.$search_val.'%');
});
}
if ($fieldname =='assigned_to') {
$query->whereHasMorph('assignedTo', [User::class], function ($query) use ($search_val) {
$query->where(function ($query) use ($search_val) {