function download_count_views_handler_sort_count::query in Download Count 6.2
File
- includes/
download_count_views_handler_sort_count.inc, line 12 - Download count per file views handler.
Class
- download_count_views_handler_sort_count
- Download count per file views sort handler.
Code
function query() {
$this->table_alias = $this
->ensure_my_table();
$sql = "SELECT COUNT(dc.fid) FROM {download_count} dc WHERE dc.fid = " . $this->table_alias . ".fid";
$this->field_alias = $this->query
->add_orderby(NULL, "(" . $sql . ")", $this->options['order'], $this->table_alias . '_' . $this->field);
}