--- a/calls.json.php +++ b/calls.json.php @@ -3,10 +3,10 @@ function getTGIDValuesByHour($TGID, $timeFrom, $timeTo) { global $conn; $sth = $conn->prepare( 'select tgid, min(call_timestamp) as time, count(*), min(length), max(length), avg(length), stddev(length) from recordings +where call_timestamp between to_timestamp(?) and to_timestamp(?) group by tgid, date_trunc(\'hour\', call_timestamp) order by time'); - $sth->execute( ); - //Array($TGID, $timeFrom, $timeTo) + $sth->execute(Array($timeFrom, $timeTo)); return $sth->fetchAll();