Fixed error, when type modules is Asyncronous type, tiquet: #2193

(cherry picked from commit 7efff21816)
This commit is contained in:
m-lopez-f 2015-05-25 10:44:20 +02:00
parent f51a36fd3d
commit c8d152c9cf
1 changed files with 3 additions and 4 deletions

View File

@ -130,7 +130,7 @@ function mainModuleGroups() {
//The big query //The big query
switch ($config["dbtype"]) { switch ($config["dbtype"]) {
case "mysql": case "mysql":
$sql = "SELECT COUNT(id_agente) AS count, case utimestamp when 0 then 5 else estado end as estado $sql = "SELECT COUNT(id_agente) AS count, estado
FROM tagente_estado FROM tagente_estado
WHERE id_agente IN WHERE id_agente IN
(SELECT id_agente FROM tagente WHERE id_grupo = %d AND disabled IS FALSE) (SELECT id_agente FROM tagente WHERE id_grupo = %d AND disabled IS FALSE)
@ -141,8 +141,7 @@ function mainModuleGroups() {
GROUP BY estado"; GROUP BY estado";
break; break;
case "postgresql": case "postgresql":
$sql = "SELECT COUNT(id_agente) AS count, $sql = "SELECT COUNT(id_agente) AS count, estado
case utimestamp when 0 then 5 else estado end as estado
FROM tagente_estado FROM tagente_estado
WHERE id_agente IN WHERE id_agente IN
(SELECT id_agente FROM tagente WHERE id_grupo = %d AND disabled = 0) (SELECT id_agente FROM tagente WHERE id_grupo = %d AND disabled = 0)
@ -153,7 +152,7 @@ function mainModuleGroups() {
GROUP BY estado, utimestamp"; GROUP BY estado, utimestamp";
break; break;
case "oracle": case "oracle":
$sql = "SELECT COUNT(id_agente) AS count, case when utimestamp = 0 then 5 else estado end estado $sql = "SELECT COUNT(id_agente) AS count, estado
FROM tagente_estado FROM tagente_estado
WHERE id_agente IN WHERE id_agente IN
(SELECT id_agente FROM tagente WHERE id_grupo = %d AND (disabled IS NOT NULL AND disabled <> 0)) (SELECT id_agente FROM tagente WHERE id_grupo = %d AND (disabled IS NOT NULL AND disabled <> 0))