From eaaaff85c22ae80784df9a06bec6a6f962bba60b Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Tue, 7 Feb 2012 19:31:25 +0000 Subject: [PATCH] Fixed the bug with wrong by page statistics --- src/messenger/webim/operator/statistics.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/messenger/webim/operator/statistics.php b/src/messenger/webim/operator/statistics.php index a2dc4dab..77b22964 100644 --- a/src/messenger/webim/operator/statistics.php +++ b/src/messenger/webim/operator/statistics.php @@ -82,7 +82,7 @@ $page['reportByAgent'] = select_multi_assoc("select vclocalename as name, COUNT( "from ${mysqlprefix}chatmessage, ${mysqlprefix}chatoperator " . "where agentId = operatorid AND unix_timestamp(dtmcreated) >= $start AND unix_timestamp(dtmcreated) < $end group by operatorid", $link); -$page['reportByPage'] = select_multi_assoc("SELECT COUNT(p.pageid) as visittimes, p.address, COUNT(t.threadid) as chattimes " . +$page['reportByPage'] = select_multi_assoc("SELECT COUNT(DISTINCT p.pageid) as visittimes, p.address, COUNT(DISTINCT t.threadid) as chattimes " . "FROM ${mysqlprefix}visitedpagestatistics p LEFT OUTER JOIN ${mysqlprefix}chatthread t ON (p.address = t.referer AND DATE(p.visittime) = DATE(t.dtmcreated)) " . "WHERE unix_timestamp(p.visittime) >= $start AND unix_timestamp(p.visittime) < $end GROUP BY p.address", $link);