Skip to content

Commit

Permalink
fix: now similar organisms list excludes the same organism name
Browse files Browse the repository at this point in the history
  • Loading branch information
sriramkanakam87 committed Sep 12, 2024
1 parent 3d4d915 commit 1999287
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/Forms/Components/OrganismsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ public function getTableData($record_name)
return Organism::select('id', 'name', urldecode('iri'), 'molecule_count')
->where('molecule_count', '>', 0)
->where(function ($q) use ($record_name) {
$q->where('name', 'ILIKE', '%'.$record_name.'%')
->orWhereRaw('? ILIKE CONCAT(\'%\', name, \'%\')', [$record_name]);
$q->where([
['name', '!=', $record_name],
['name', 'ILIKE', '%'.$record_name.'%']
]);
})
->get();
}
Expand Down

0 comments on commit 1999287

Please sign in to comment.