[-] FO : Fix bug #PSCFV-10892, getCMSPages by id_shop thnaks @jd440
This commit is contained in:
+4
-1
@@ -190,7 +190,7 @@ class CMSCore extends ObjectModel
|
|||||||
return (Db::getInstance()->getValue($sql));
|
return (Db::getInstance()->getValue($sql));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getCMSPages($id_lang = null, $id_cms_category = null, $active = true)
|
public static function getCMSPages($id_lang = null, $id_cms_category = null, $active = true, $id_shop = null)
|
||||||
{
|
{
|
||||||
$sql = new DbQuery();
|
$sql = new DbQuery();
|
||||||
$sql->select('*');
|
$sql->select('*');
|
||||||
@@ -198,6 +198,9 @@ class CMSCore extends ObjectModel
|
|||||||
if ($id_lang)
|
if ($id_lang)
|
||||||
$sql->innerJoin('cms_lang', 'l', 'c.id_cms = l.id_cms AND l.id_lang = '.(int)$id_lang);
|
$sql->innerJoin('cms_lang', 'l', 'c.id_cms = l.id_cms AND l.id_lang = '.(int)$id_lang);
|
||||||
|
|
||||||
|
if ($id_shop)
|
||||||
|
$sql->innerJoin('cms_shop', 'cs', 'c.id_cms = cs.id_cms AND cs.id_shop = '.(int)$id_shop);
|
||||||
|
|
||||||
if ($active)
|
if ($active)
|
||||||
$sql->where('c.active = 1');
|
$sql->where('c.active = 1');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user