public function actionToursCategory() { Yii::app()->page->title = "Лог по турам"; if ($this->beginCache("console_log_tours_category", array('duration' => 3600 * 12))) { $list = CatLogToursCountry::sql("SELECT log.count, c.name FROM cat_log_tours_category log, catalog_tours_category c WHERE log.date2='" . date("Y-m") . "' AND c.id = log.category_id ORDER BY log.count DESC"); $rows = ""; for ($i = 0; $i < sizeof($list); $i++) { if (!empty($rows)) { $rows .= ","; } $rows .= "['" . $list[$i]["name"] . "', " . $list[$i]["count"] . ", 0, '#3366cc' ]"; } $this->render("toursCategory", array("rows" => $rows)); $this->endCache(); } }