mirror of
https://github.com/nextcloud/server.git
synced 2025-10-26 19:21:34 +00:00
Simplify comment search in special cases
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
b0fbcccfe6
commit
d05dca0c1c
@ -611,13 +611,16 @@ class Manager implements ICommentsManager {
|
||||
|
||||
$query->select('*')
|
||||
->from('comments')
|
||||
->where($query->expr()->iLike('message', $query->createNamedParameter(
|
||||
'%' . $this->dbConn->escapeLikeParameter($search). '%'
|
||||
)))
|
||||
->orderBy('creation_timestamp', 'DESC')
|
||||
->addOrderBy('id', 'DESC')
|
||||
->setMaxResults($limit);
|
||||
|
||||
if ($search !== '') {
|
||||
$query->where($query->expr()->iLike('message', $query->createNamedParameter(
|
||||
'%' . $this->dbConn->escapeLikeParameter($search). '%'
|
||||
)));
|
||||
}
|
||||
|
||||
if ($objectType !== '') {
|
||||
$query->andWhere($query->expr()->eq('object_type', $query->createNamedParameter($objectType)));
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user