// sql query improvement for $feature->nbFeatures()
This commit is contained in:
1 parent
1706325137
commit
27b3803da5
1 file changed
+5
-5
+5
-5
@@ -188,12 +188,12 @@ class FeatureCore extends ObjectModel
|
|||||||
*/
|
*/
|
||||||
public static function nbFeatures($id_lang)
|
public static function nbFeatures($id_lang)
|
||||||
{
|
{
|
||||||
$result = Db::getInstance()->getRow('
|
return Db::getInstance()->getValue('
|
||||||
SELECT COUNT(ag.`id_feature`) as nb
|
SELECT COUNT(*) as nb
|
||||||
FROM `'._DB_PREFIX_.'feature` ag
|
FROM `'._DB_PREFIX_.'feature` ag
|
||||||
LEFT JOIN `'._DB_PREFIX_.'feature_lang` agl ON (ag.`id_feature` = agl.`id_feature` AND `id_lang` = '.(int)$id_lang.')
|
LEFT JOIN `'._DB_PREFIX_.'feature_lang` agl
|
||||||
ORDER BY `name` ASC');
|
ON (ag.`id_feature` = agl.`id_feature` AND `id_lang` = '.(int)$id_lang.')
|
||||||
return ($result['nb']);
|
');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user