public function actionAjax() { $model = new Games(); if ($_POST['gid']) { $gameServerId = $model->getGamesServerId($_POST['gid']); if ($gameServerId) { //$returnValue='<select>'; $i = 1; foreach ($gameServerId as $row) { $returnValue .= '<option value="' . $row . '">918双线' . $i . '区</option>'; $i++; } echo $returnValue; } } }