eee
This commit is contained in:
@@ -121,9 +121,9 @@ class Gii
|
||||
$this->tableName = $input->getOption('table');
|
||||
}
|
||||
return match ($make) {
|
||||
'controller' => $this->getTable(1, 0),
|
||||
'model' => $this->getTable(0, 1),
|
||||
default => [],
|
||||
'controller' => $this->getTable($input, 1, 0),
|
||||
'model' => $this->getTable($input, 0, 1),
|
||||
default => [],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ class Gii
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
private function getTable($controller, $model): array
|
||||
private function getTable($input, $controller, $model): array
|
||||
{
|
||||
$tables = $this->getFields($this->getTables());
|
||||
if (empty($tables)) {
|
||||
@@ -146,10 +146,10 @@ class Gii
|
||||
foreach ($tables as $key => $val) {
|
||||
$data = $this->createModelFile($key, $val);
|
||||
if ($controller == 1) {
|
||||
$fileList[] = $this->generateController($data);
|
||||
$fileList[] = $this->generateController($input, $data);
|
||||
}
|
||||
if ($model == 1) {
|
||||
$fileList[] = $this->generateModel($data);
|
||||
$fileList[] = $this->generateModel($input, $data);
|
||||
}
|
||||
}
|
||||
return $fileList;
|
||||
@@ -217,7 +217,7 @@ class Gii
|
||||
private function showAll(): array
|
||||
{
|
||||
$res = [];
|
||||
$_tables = Db::connect($this->db)->fetchAll('SHOW TABLES FROM `' . $this->db->database . '`');
|
||||
$_tables = Db::connect($this->db)->fetchAll('SHOW TABLES FROM `' . $this->db->database . '`');
|
||||
if (empty($_tables)) {
|
||||
return $res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user