<?php
class LogBusca extends UtilObjeto {

	public function __construct($params=""){
		parent::__construct(strtolower(get_class()), $params);
	}

	public static function listarTopBusca($filtro=""){
		global $db;
        $sql = "SELECT * FROM(
					SELECT busca, count(*) total
					FROM   rz2_log_busca
					WHERE  1 = 1
					".$filtro."
					GROUP BY busca) log
				ORDER BY total DESC, busca";
        // exit($sql);
        $rs = executaSql($sql);
        $arrLista = array();
        while($rg = $rs->fetchRow()){
			$arrLista[$rg['busca']] = $rg['total'];
        }
        return (count($arrLista) > 0) ? $arrLista : false;
	}
	
}
?>