Skip to content

Commit

Permalink
cs
Browse files Browse the repository at this point in the history
  • Loading branch information
alikon committed Jun 13, 2019
1 parent 99e264c commit f1a4c8b
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions administrator/components/com_content/Model/FeaturedModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,25 +265,28 @@ protected function getListQuery()
elseif (stripos($search, 'author:') === 0)
{
$search = '%' . substr($search, 7) . '%';
$query->where('(' . $db->quoteName('ua.name') . ' LIKE :name' .
' OR ' . $db->quoteName('ua.username') . ' LIKE :uname'. ')');
$query->bind(':name', $search)
$query->where($db->quoteName('ua.name') . ' LIKE :name')
->orWhere($db->quoteName('ua.username') . ' LIKE :uname')
->bind(':name', $search)
->bind(':uname', $search);
}
elseif (stripos($search, 'content:') === 0)
{
$search = '%' . substr($search, 8) . '%';
$query->where('(a.introtext LIKE ' . $search . ' OR a.fulltext LIKE ' . $search . ')');
$query->where($db->quoteName('a.introtext') . ' LIKE :intro')
->orWhere($db->quoteName('a.fulltext') . ' LIKE :full')
->bind(':intro', $search)
->bind(':full', $search);
}
else
{
$search = '%' . trim($search) . '%';
$query->where('(' . $db->quoteName('a.title') . ' LIKE :title' .
' OR ' . $db->quoteName('a.alias') . ' LIKE :alias' .
' OR '. $db->quoteName('a.note') . ' LIKE :note' . ')');
$query->bind(':title', $search)
$query->where($db->quoteName('a.title') . ' LIKE :title')
->orWhere($db->quoteName('a.alias') . ' LIKE :alias')
->orWhere($db->quoteName('a.note') . ' LIKE :note')
->bind(':title', $search)
->bind(':alias', $search)
->bind(':note', $search);
->bind(':note', $search);
}
}

Expand All @@ -309,10 +312,10 @@ protected function getListQuery()
if ($tagId)
{
$subQuery = $db->getQuery(true)
->select('DISTINCT content_item_id')
->select('DISTINCT ' . $db->quoteName('content_item_id'))
->from($db->quoteName('#__contentitem_tag_map'))
->whereIn($db->quoteName('tag_id'), $tagId)
->where('type_alias = ' . $db->quote('com_content.article'));
->where($db->quoteName('type_alias') . ' = ' . $db->quote('com_content.article'));

$query->join('INNER', '(' . (string) $subQuery . ') AS tagmap ON tagmap.content_item_id = a.id');
}
Expand Down

0 comments on commit f1a4c8b

Please sign in to comment.