public function getRecentStatistics($days = 1, $handled)
{
$handled = (int) $handled;
if (!$handled) {
$handled = 0;
}
$result = craft()->db->createCommand()->select('*')->from('retour_stats')->where("hitLastTime >= ( CURDATE() - INTERVAL '{$days}' DAY )")->andWhere('handledByRetour =' . $handled)->order('hitLastTime DESC')->queryAll();
return $result;
}