From 3f57d1f64aee8b43bbe89a3303c8dff8e8115e6c Mon Sep 17 00:00:00 2001 From: lBrieu Date: Tue, 30 Aug 2011 08:37:37 +0000 Subject: [PATCH] git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8240 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/Notification.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/classes/Notification.php b/classes/Notification.php index 2f971318d..db0d47b2a 100644 --- a/classes/Notification.php +++ b/classes/Notification.php @@ -42,7 +42,10 @@ class Notification public static function getLastElementsIdsByType($type, $id_last_element) { - return Db::getInstance()->ExecuteS('SELECT id_'.$type.' FROM `'._DB_PREFIX_.(($type == 'order') ? $type.'s' : $type).'` WHERE `id_'.$type.'` > '.$id_last_element.' ORDER BY `id_'.$type.'` DESC LIMIT 5'); + if($type == 'order' || $type == 'message') + return Db::getInstance()->ExecuteS('SELECT id_order FROM `'._DB_PREFIX_.(($type == 'order') ? $type.'s' : $type).'` WHERE `id_'.$type.'` > '.$id_last_element.' ORDER BY `id_'.$type.'` DESC LIMIT 5'); + else + return Db::getInstance()->ExecuteS('SELECT id_'.$type.' FROM `'._DB_PREFIX_.$type.'` WHERE `id_'.$type.'` > '.$id_last_element.' ORDER BY `id_'.$type.'` DESC LIMIT 5'); } public function updateEmployeeLastElement($type) @@ -60,4 +63,4 @@ class Notification } } } -?> +?> \ No newline at end of file