- Patch #229051 by Josh Waihi, bellHead, ainigma32, Dave Reid, druido, ivanSB@drupal.org, jaydub: fixed 'Top visitor' page on PostgreSQL 8.3.

merge-requests/26/head
Dries Buytaert 2010-01-26 08:19:45 +00:00
parent 6cb277926f
commit 420c27c489
1 changed files with 4 additions and 2 deletions

View File

@ -118,8 +118,10 @@ function statistics_top_visitors() {
->limit(30)
->orderByHeader($header);
$count_query = db_select('accesslog');
$count_query->addExpression('COUNT(DISTINCT CONCAT(CAST(uid AS char), hostname))');
$uniques_query = db_select('accesslog')->distinct();
$uniques_query->fields('accesslog', array('uid', 'hostname'));
$count_query = db_select($uniques_query);
$count_query->addExpression('COUNT(*)');
$query->setCountQuery($count_query);
$result = $query->execute();