From 1999287985b9cc9a5a1ba1a554e342943277b7ea Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 12 Sep 2024 14:42:44 +0200 Subject: [PATCH] fix: now similar organisms list excludes the same organism name --- app/Forms/Components/OrganismsTable.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Forms/Components/OrganismsTable.php b/app/Forms/Components/OrganismsTable.php index 6ace60ff..fe513f3a 100644 --- a/app/Forms/Components/OrganismsTable.php +++ b/app/Forms/Components/OrganismsTable.php @@ -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(); }