mirror of
https://github.com/joomla-extensions/patchtester.git
synced 2025-01-23 15:18:36 +00:00
Refactor search filter (Fix #30)
This commit is contained in:
parent
b3c68f1935
commit
ed0ccf0c5f
@ -122,15 +122,12 @@ class PatchtesterModelPulls extends JModelList
|
||||
|
||||
if (!empty($search))
|
||||
{
|
||||
if (stripos($search, 'id:') === 0)
|
||||
{
|
||||
$query->where($db->quoteName('a.pull_id') . ' = ' . (int) substr($search, 3));
|
||||
}
|
||||
else
|
||||
{
|
||||
$search = $db->quote('%' . $db->escape($search, true) . '%');
|
||||
$query->where('(' . $db->quoteName('a.title') . ' LIKE ' . $search . ')');
|
||||
}
|
||||
$search = $db->quote('%' . $db->escape($search, true) . '%');
|
||||
$query->where(
|
||||
'(' . $db->quoteName('a.title') . ' LIKE ' . $search . ') OR ' .
|
||||
'(' . $db->quoteName('a.pull_id') . ' LIKE ' . $search . ') OR ' .
|
||||
'(' . $db->quoteName('a.joomlacode_id') . ' LIKE ' . $search . ')'
|
||||
);
|
||||
}
|
||||
|
||||
// Handle the list ordering.
|
||||
|
Loading…
x
Reference in New Issue
Block a user