This commit is contained in:
2020-09-08 16:08:22 +08:00
parent 6cbe538401
commit 39e736332e
+7 -7
View File
@@ -72,22 +72,22 @@ class Gii
$model = 1; $model = 1;
} }
if ($input->get('controller', NULL)) { if ($input->get('controller', NULL)) {
$c = 1; $controller = 1;
} }
if ($input->get('isUpdate') == 1) { if ($input->get('isUpdate') == 1) {
$this->isUpdate = TRUE; $this->isUpdate = TRUE;
} }
return $this->getTable($c, $model); return $this->getTable($controller, $model);
} }
/** /**
* @param $m * @param $controller
* @param $c * @param $model
* @return array * @return array
* *
* @throws Exception * @throws Exception
*/ */
private function getTable(&$c, &$m) private function getTable(&$controller, &$model)
{ {
$tables = $this->getFields($this->getTables()); $tables = $this->getFields($this->getTables());
if (empty($tables)) { if (empty($tables)) {
@@ -97,10 +97,10 @@ class Gii
$fileList = []; $fileList = [];
foreach ($tables as $key => $val) { foreach ($tables as $key => $val) {
$data = $this->createModelFile($key, $val); $data = $this->createModelFile($key, $val);
if ($m == 1) { if ($controller == 1) {
$fileList[] = $this->generateModel($data); $fileList[] = $this->generateModel($data);
} }
if ($c == 1) { if ($model == 1) {
$fileList[] = $this->generateController($data); $fileList[] = $this->generateController($data);
} }
} }