// Some optimization #PI-121
This commit is contained in:
@@ -491,7 +491,6 @@ class ShopCore extends ObjectModel
|
||||
'name' => $row['group_name'],
|
||||
'share_customer' => $row['share_customer'],
|
||||
'share_order' => $row['share_order'],
|
||||
'totalShops' => Shop::getTotalShopsByIdShopGroup($row['id_shop_group']),
|
||||
'shops' => array(),
|
||||
);
|
||||
|
||||
@@ -573,31 +572,6 @@ class ShopCore extends ObjectModel
|
||||
return count(Shop::getShops($active));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int Total of shops
|
||||
*/
|
||||
public static function getTotalShopsWhoExists()
|
||||
{
|
||||
return (int)Db::getInstance()->getValue('SELECT COUNT(*) FROM `'._DB_PREFIX_.'shop`');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int Total of shops
|
||||
*/
|
||||
public static function getTotalShopsByIdShopGroup($id)
|
||||
{
|
||||
return (int)Db::getInstance()->getValue('SELECT COUNT(*) FROM `'._DB_PREFIX_.'shop` WHERE `id_shop_group` = '.(int)$id);
|
||||
}
|
||||
|
||||
public static function getIdShopsByIdShopGroup($id)
|
||||
{
|
||||
$result = Db::getInstance()->executeS('SELECT `id_shop`, `id_shop_group` FROM `'._DB_PREFIX_.'shop` WHERE `id_shop_group` = '.(int)$id);
|
||||
$data = array();
|
||||
foreach ($result as $group_data)
|
||||
$data[] = (int)$group_data['id_shop'];
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve group ID of a shop
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user