mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-26 20:22:18 +00:00
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:
parent
41ac69adb1
commit
81d6b1b016
@ -156,7 +156,9 @@ class SearchRunner
|
|||||||
})->groupBy('entity_type', 'entity_id');
|
})->groupBy('entity_type', 'entity_id');
|
||||||
$entitySelect->join($this->db->raw('(' . $subQuery->toSql() . ') as s'), function (JoinClause $join) {
|
$entitySelect->join($this->db->raw('(' . $subQuery->toSql() . ') as s'), function (JoinClause $join) {
|
||||||
$join->on('id', '=', 'entity_id');
|
$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);
|
$entitySelect->mergeBindings($subQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user