From fc88323443a67d434f4c44edb422e86d1ed4bb1f Mon Sep 17 00:00:00 2001 From: vChabot Date: Tue, 27 Sep 2011 12:54:47 +0000 Subject: [PATCH] // perf git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8801 b9a71923-0436-4b27-9f14-aed3839534dd --- admin-dev/tabs/AdminProducts.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/admin-dev/tabs/AdminProducts.php b/admin-dev/tabs/AdminProducts.php index e3659e2c2..668388bfe 100644 --- a/admin-dev/tabs/AdminProducts.php +++ b/admin-dev/tabs/AdminProducts.php @@ -860,7 +860,7 @@ class AdminProducts extends AdminTab if (Shop::isMultiShopActivated()) $shops = Shop::getShops(); $obj = new Product((int)Tools::getValue('id_product')); - $countImages = (int)Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'image WHERE id_product = '.(int)$obj->id); + $countImages = (int)Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'image WHERE id_product = '.(int)$obj->id); $images = Image::getImages($this->context->language->id, $obj->id); $imagesTotal = Image::getImagesTotal($obj->id); $html = $this->getLineTableImage($result['success'], $imagesTotal + 1, $this->token, $shops); @@ -1492,8 +1492,8 @@ class AdminProducts extends AdminTab $this->displayFormInformations($obj, $currency); $this->displayFormImages($obj, $this->token); if (Combination::isFeatureActive()) - $countAttributes = (int)Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'product_attribute WHERE id_product = '.(int)$obj->id); - $countAttachments = (int)Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'product_attachment WHERE id_product = '.(int)$obj->id); + $countAttributes = (int)Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'product_attribute WHERE id_product = '.(int)$obj->id); + $countAttachments = (int)Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'product_attachment WHERE id_product = '.(int)$obj->id); if ($obj->id) echo '

3. '.$this->l('Prices').'

@@ -2644,7 +2644,7 @@ class AdminProducts extends AdminTab // Check if product has combination, to display the available date only for the product or for each combination if (Combination::isFeatureActive()) - $countAttributes = (int)Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'product_attribute WHERE id_product = '.(int)$obj->id); + $countAttributes = (int)Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'product_attribute WHERE id_product = '.(int)$obj->id); if (isset($countAttributes) && $countAttributes == 0) { @@ -3026,7 +3026,7 @@ class AdminProducts extends AdminTab if (Shop::isMultiShopActivated()) $shops = Shop::getShops(); - $countImages = (int)Db::getInstance()->getValue('SELECT COUNT(*) FROM '._DB_PREFIX_.'image WHERE id_product = '.(int)$obj->id); + $countImages = (int)Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'image WHERE id_product = '.(int)$obj->id); $images = Image::getImages($this->context->language->id, $obj->id); $imagesTotal = Image::getImagesTotal($obj->id);