[-] BO: Fix SQL error on click on notification if no new notifications

This commit is contained in:
Rémi Gaillard
2013-03-06 12:05:34 +01:00
parent 1cf72fa19a
commit 7ff4c4d0b2
+1 -1
View File
@@ -148,7 +148,7 @@ class NotificationCore
return Db::getInstance()->execute('
UPDATE `'._DB_PREFIX_.'employee`
SET `id_last_'.bqSQL($type).'` = (
SELECT MAX(`id_'.$type.'`)
SELECT IFNULL(MAX(`id_'.$type.'`), 0)
FROM `'._DB_PREFIX_.(($type == 'order') ? bqSQL($type).'s' : bqSQL($type)).'`
)
WHERE `id_employee` = '.(int)$cookie->id_employee);