Fixed search query issues when table prefixes are used

- Old raw select query was causing bad select clause in query
  when table prefixes were active.
This commit is contained in:
Dan Brown 2021-10-08 15:25:12 +01:00
parent 41ac69adb1
commit 81d6b1b016
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9

View File

@ -156,7 +156,9 @@ class SearchRunner
})->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);
}