public static function getR18MostPopular($numberOfItem) { $mostPopularIllustList = Illust::model()->findAllBySql('Select * from illust where is_r18 = 1 order by non_user_popularity DESC,popularity DESC,created_datetime DESC limit ' . $numberOfItem); return $mostPopularIllustList; }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Illust the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Illust::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }