Skip to content

Commit

Permalink
fix: list search is improved
Browse files Browse the repository at this point in the history
  • Loading branch information
sriramkanakam87 committed Sep 12, 2024
1 parent 1999287 commit 643614f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Forms/Components/OrganismsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ public function getTableData($record_name)
return Organism::select('id', 'name', urldecode('iri'), 'molecule_count')
->where('molecule_count', '>', 0)
->where(function ($q) use ($record_name) {
$arr = explode(' ', $record_name);
$sanitised_org_name = $arr[0].' '.$arr[1];
$q->where([
['name', '!=', $record_name],
['name', 'ILIKE', '%'.$record_name.'%']
['name', 'ILIKE', '%'.$sanitised_org_name.'%']
]);
})
->get();
Expand Down

0 comments on commit 643614f

Please sign in to comment.