Merge pull request #11651 from inietov/fixes/activity_report_search

Fixed Search in activity report for full name in relation
This commit is contained in:
snipe 2022-08-22 16:23:50 -07:00 committed by GitHub
commit 3ac84eab58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -162,6 +162,10 @@ trait Searchable
$query->orWhere($table.'.'.$column, 'LIKE', '%'.$term.'%');
}
}
// I put this here because I only want to add the concat one time in the end of the user relation search
if($relation == 'user') {
$query->orWhereRaw('CONCAT (users.first_name, " ", users.last_name) LIKE ?', ["%$term%"]);
}
});
}