summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/classes.inc.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-11-30 11:09:33 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-11-30 11:09:33 +0000
commit7fcb30f02c1dfae9caaab498c2269b6f2cd1ff25 (patch)
tree6da05f089e572f58207f7a3593af432e5e7b3d41 /frontends/php/include/classes.inc.php
parent13720ef034595b53f10251d8d9fada5fa8c8048e (diff)
downloadzabbix-7fcb30f02c1dfae9caaab498c2269b6f2cd1ff25.tar.gz
zabbix-7fcb30f02c1dfae9caaab498c2269b6f2cd1ff25.tar.xz
zabbix-7fcb30f02c1dfae9caaab498c2269b6f2cd1ff25.zip
More changes for trending
git-svn-id: svn://svn.zabbix.com/trunk@1075 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/classes.inc.php')
-rw-r--r--frontends/php/include/classes.inc.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/frontends/php/include/classes.inc.php b/frontends/php/include/classes.inc.php
index 6c75f9e0..ae30ab6c 100644
--- a/frontends/php/include/classes.inc.php
+++ b/frontends/php/include/classes.inc.php
@@ -411,7 +411,14 @@
}
$str=substr($str,0,strlen($str)-1);
- $sql="select itemid,round(900*((clock+$z)%($p))/($p),0) as i,count(*) as count,avg(value) as avg,min(value) as min,max(value) as max from history where itemid in ($str) and clock>=".$this->from_time." and clock<=".$this->to_time." group by itemid,round(900*((clock+$z)%($p))/($p),0)";
+ if($this->period<=24*3600)
+ {
+ $sql="select itemid,round(900*((clock+$z)%($p))/($p),0) as i,count(*) as count,avg(value) as avg,min(value) as min,max(value) as max from history where itemid in ($str) and clock>=".$this->from_time." and clock<=".$this->to_time." group by itemid,round(900*((clock+$z)%($p))/($p),0)";
+ }
+ else
+ {
+ $sql="select itemid,round(900*((clock+$z)%($p))/($p),0) as i,sum(num) as count,avg(value_avg) as avg,min(value_min) as min,max(value_max) as max from trends where itemid in ($str) and clock>=".$this->from_time." and clock<=".$this->to_time." group by itemid,round(900*((clock+$z)%($p))/($p),0)";
+ }
// echo $sql;
$result=DBselect($sql);