// improve hasInvoice method

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11142 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
aFolletete
2011-12-12 15:57:11 +00:00
parent d14f750a24
commit 6f3972d946
+8 -4
View File
@@ -1589,10 +1589,14 @@ class OrderCore extends ObjectModel
*/
public function hasInvoice()
{
return Db::getInstance()->getValue('
SELECT COUNT(*)
FROM `'._DB_PREFIX_.'order_invoice`
WHERE `id_order` = '.(int)$this->id);
if (Db::getInstance()->getRow('
SELECT *
FROM `'._DB_PREFIX_.'order_invoice`
WHERE `id_order` = '.(int)$this->id.'
LIMIT 1')
)
return true;
return false;
}
}