Skip to content

Commit

Permalink
Fixed search query issues when table prefixes are used
Browse files Browse the repository at this point in the history
- Old raw select query was causing bad select clause in query
  when table prefixes were active.
  • Loading branch information
ssddanbrown committed Oct 8, 2021
1 parent 41ac69a commit 81d6b1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Entities/Tools/SearchRunner.php
Expand Up @@ -156,7 +156,9 @@ protected function buildEntitySearchQuery(SearchOptions $searchOpts, string $ent
})->groupBy('entity_type', 'entity_id');
$entitySelect->join($this->db->raw('(' . $subQuery->toSql() . ') as s'), function (JoinClause $join) {
$join->on('id', '=', 'entity_id');
})->selectRaw($entity->getTable() . '.*, s.score')->orderBy('score', 'desc');
})->addSelect($entity->getTable() . '.*')
->selectRaw('s.score')
->orderBy('score', 'desc');
$entitySelect->mergeBindings($subQuery);
}

Expand Down

0 comments on commit 81d6b1b

Please sign in to comment.