- Patch #229051 by Josh Waihi, bellHead, ainigma32, Dave Reid, druido, ivanSB@drupal.org, jaydub: fixed 'Top visitor' page on PostgreSQL 8.3.
parent
6cb277926f
commit
420c27c489
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue