opnsense-ports/www/asterisk-stat/files/pgsql__patch-call.log.php
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01:00

9 lines
596 B
PHP

--- call-log.php.orig 2012-04-05 10:48:18.000000000 +0300
+++ call-log.php 2012-04-05 10:48:29.000000000 +0300
@@ -229,7 +229,7 @@
/************************/
- $QUERY = "SELECT substring(calldate,1,10) AS day, sum(duration) AS calltime, count(*) as nbcall FROM cdr WHERE ".$FG_TABLE_CLAUSE." GROUP BY substring(calldate,1,10)"; //extract(DAY from calldate)
+ $QUERY = "SELECT cast(calldate as date) AS day, sum(duration) AS calltime, count(*) as nbcall FROM cdr WHERE ".$FG_TABLE_CLAUSE." GROUP BY cast(calldate as date) order by 1 desc"; //extract(DAY from calldate)
//echo "$QUERY";