public function actionIndex() { $serverId = $_GET['serverid']; $gamesName = $_GET['gametype']; if ($serverId && $gamesName && $_GET['gid']) { /* * 魔神战纪的接口 */ if ($gamesName == 'mszj') { $gamesServerId = Games::model()->findByAttributes(array('id' => $_GET['gid'])); $gamesApi = GamesApi::model()->findByAttributes(array('gid' => $_GET['gid'])); $gamesServerId = unserialize($gamesServerId->server_id); $mid = Yii::app()->user->id; if ($gamesServerId) { $this->memberGames($mid, $_GET['gid'], $gamesServerId[--$serverId]); header("Location:http://res1.mszj.wowan365.com/bin/WebLaucher.html?userid=" . $gamesApi->userid . "&username="******"&time=" . time() . "&flag=8920bf1232e4f0d50fae4a494a2f8dab&cm=1&server_id=" . $gamesServerId[--$serverId] . "&country=%E5%8C%97%E4%BA%AC%E5%B8%82"); } } } }
/** * 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 the ID of the model to be loaded */ public function loadModel($id) { $model = GamesApi::model()->findByPk((int) $id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }