mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2025-01-27 14:28:30 +00:00
Fix prepared statement, we need different parameters to bind same value :(
This commit is contained in:
parent
8b9d34ca7d
commit
226e81f7ab
@ -251,8 +251,9 @@ class WeblinksModel extends ListModel
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$search = '%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%');
|
$search = '%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%');
|
||||||
$query->where('(' . $db->quoteName('a.title') . ' LIKE :search OR ' . $db->quoteName('a.alias') . ' LIKE :search)')
|
$query->where('(' . $db->quoteName('a.title') . ' LIKE :title OR ' . $db->quoteName('a.alias') . ' LIKE :alias)')
|
||||||
->bind(':search', $search);
|
->bind(':title', $search)
|
||||||
|
->bind(':alias', $search);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,10 +175,12 @@ class CategoryModel extends ListModel
|
|||||||
{
|
{
|
||||||
$nullDate = $db->getNullDate();
|
$nullDate = $db->getNullDate();
|
||||||
$nowDate = Factory::getDate()->toSql();
|
$nowDate = Factory::getDate()->toSql();
|
||||||
$query->where('(a.publish_up = :nullDate OR a.publish_up <= :nowDate)')
|
$query->where('(a.publish_up = :publishUpNullDate OR a.publish_up <= :publishUpNowDate)')
|
||||||
->where('(a.publish_down = :nullDate OR a.publish_down >= :nowDate)')
|
->where('(a.publish_down = :publishDownNullDate OR a.publish_down >= :publishDownNowDate)')
|
||||||
->bind(':nullDate', $nullDate)
|
->bind(':publishUpNullDate', $nullDate)
|
||||||
->bind(':nowDate', $nowDate);
|
->bind(':publishDownNullDate', $nullDate)
|
||||||
|
->bind(':publishUpNowDate', $nowDate)
|
||||||
|
->bind(':publishDownNowDate', $nowDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter by language
|
// Filter by language
|
||||||
|
@ -91,7 +91,7 @@ class WeblinkModel extends ItemModel
|
|||||||
$query = $db->getQuery(true)
|
$query = $db->getQuery(true)
|
||||||
->select($this->getState('item.select', 'a.*'))
|
->select($this->getState('item.select', 'a.*'))
|
||||||
->from('#__weblinks AS a')
|
->from('#__weblinks AS a')
|
||||||
->where($db->quoteName('id') . ' = :id')
|
->where($db->quoteName('a.id') . ' = :id')
|
||||||
->bind(':id', $pk, ParameterType::INTEGER);
|
->bind(':id', $pk, ParameterType::INTEGER);
|
||||||
|
|
||||||
// Join on category table.
|
// Join on category table.
|
||||||
@ -119,10 +119,12 @@ class WeblinkModel extends ItemModel
|
|||||||
$nullDate = $db->getNullDate();
|
$nullDate = $db->getNullDate();
|
||||||
$nowDate = Factory::getDate()->toSql();
|
$nowDate = Factory::getDate()->toSql();
|
||||||
|
|
||||||
$query->where('(a.publish_up = :nullDate OR a.publish_up <= :nowDate)')
|
$query->where('(a.publish_up = :publishUpNullDate OR a.publish_up <= :publishUpNowDate)')
|
||||||
->where('(a.publish_down = :nullDate OR a.publish_down >= :nowDate)')
|
->where('(a.publish_down = :publishDownNullDate OR a.publish_down >= :publishDownNowDate)')
|
||||||
->bind(':nullDate', $nullDate)
|
->bind(':publishUpNullDate', $nullDate)
|
||||||
->bind(':nowDate', $nowDate);
|
->bind(':publishDownNullDate', $nullDate)
|
||||||
|
->bind(':publishUpNowDate', $nowDate)
|
||||||
|
->bind(':publishDownNowDate', $nowDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter by published state.
|
// Filter by published state.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user