// Added number of features + norm
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12899 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -655,11 +655,8 @@ class AdminAttributesGroupsControllerCore extends AdminController
|
|||||||
$query->where('a.id_attribute_group ='.(int)$item['id_attribute_group']);
|
$query->where('a.id_attribute_group ='.(int)$item['id_attribute_group']);
|
||||||
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
|
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
|
||||||
$item['count_values'] = (int)$res;
|
$item['count_values'] = (int)$res;
|
||||||
|
unset($query);
|
||||||
unset($res);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -513,4 +513,31 @@ class AdminFeaturesControllerCore extends AdminController
|
|||||||
else
|
else
|
||||||
return $this->processUpdate($token);
|
return $this->processUpdate($token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AdminController::getList() override
|
||||||
|
* @see AdminController::getList()
|
||||||
|
*/
|
||||||
|
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
|
||||||
|
{
|
||||||
|
parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);
|
||||||
|
|
||||||
|
if ($this->table == 'feature')
|
||||||
|
{
|
||||||
|
$nb_items = count($this->_list);
|
||||||
|
for ($i = 0; $i < $nb_items; ++$i)
|
||||||
|
{
|
||||||
|
$item = &$this->_list[$i];
|
||||||
|
|
||||||
|
$query = new DbQuery();
|
||||||
|
$query->select('COUNT(id_feature_value) as count_values');
|
||||||
|
$query->from('feature_value', 'fv');
|
||||||
|
$query->where('fv.id_feature ='.(int)$item['id_feature']);
|
||||||
|
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
|
||||||
|
$item['value'] = (int)$res;
|
||||||
|
unset($query);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user