Merge remote-tracking branch 'origin/development' into development
This commit is contained in:
commit
5c66ed4791
1 file changed
+8
-19
+8
-19
@@ -325,25 +325,14 @@ class GroupCore extends ObjectModel
|
|||||||
* @param boolean $unrestricted allows search without lang and includes first group and exact match
|
* @param boolean $unrestricted allows search without lang and includes first group and exact match
|
||||||
* @return array Corresponding groupes
|
* @return array Corresponding groupes
|
||||||
*/
|
*/
|
||||||
public static function searchByName($id_lang, $query, $unrestricted = false)
|
public static function searchByName($id_lang, $query)
|
||||||
{
|
{
|
||||||
if ($unrestricted === true)
|
return Db::getInstance()->getRow('
|
||||||
return Db::getInstance()->getRow('
|
SELECT g.*, gl.*
|
||||||
SELECT g.*, gl.*
|
FROM `'._DB_PREFIX_.'group` g
|
||||||
FROM `'._DB_PREFIX_.'group` g
|
LEFT JOIN `'._DB_PREFIX_.'group_lang` gl
|
||||||
LEFT JOIN `'._DB_PREFIX_.'group_lang` gl
|
ON (g.`id_group` = gl.`id_group`)
|
||||||
ON (g.`id_group` = gl.`id_group`)
|
WHERE `name` LIKE \''.pSQL($query).'\'
|
||||||
WHERE `name` LIKE \''.pSQL($query).'\'
|
');
|
||||||
');
|
|
||||||
else
|
|
||||||
return Db::getInstance()->executeS('
|
|
||||||
SELECT g.*, gl.*
|
|
||||||
FROM `'._DB_PREFIX_.'group` g
|
|
||||||
LEFT JOIN `'._DB_PREFIX_.'group_lang` gl
|
|
||||||
ON (g.`id_group` = gl.`id_group`
|
|
||||||
AND `id_lang` = '.(int)$id_lang.')
|
|
||||||
WHERE `name` LIKE \'%'.pSQL($query).'%\'
|
|
||||||
AND g.`id_group` != '.(int)Configuration::get('PS_HOME_CATEGORY')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user