function actionSystemTop() { header('Content-type: application/json'); if (!IjoyPlusServiceUtils::validateAPPKey()) { IjoyPlusServiceUtils::exportServiceError(Constants::APP_KEY_INVALID); return; } $page_size = Yii::app()->request->getParam("page_size"); $page_num = Yii::app()->request->getParam("page_num"); if (!(isset($page_size) && is_numeric($page_size))) { $page_size = 10; $page_num = 1; } else { if (!(isset($page_num) && is_numeric($page_num))) { $page_num = 1; } } try { $topic_type = Yii::app()->request->getParam("topic_type"); if ($topic_type === null || $topic_type === '') { $lists = SearchManager::tops($page_size, $page_size * ($page_num - 1)); } else { $lists = SearchManager::tops_type($page_size, $page_size * ($page_num - 1), $topic_type); } if (isset($lists) && is_array($lists)) { IjoyPlusServiceUtils::exportEntity(array('tops' => $lists)); } else { IjoyPlusServiceUtils::exporptEntity(array('tops' => array())); } } catch (Exception $e) { Yii::log(CJSON::encode($e), "error"); IjoyPlusServiceUtils::exportServiceError(Constants::SYSTEM_ERROR); } }