This commit is contained in:
2021-01-19 19:01:50 +08:00
parent 0408ff15b6
commit 1786916508
2 changed files with 4 additions and 5 deletions
+1 -3
View File
@@ -32,9 +32,7 @@ class Command extends \Console\Command
/** @var Gii $gii */ /** @var Gii $gii */
$gii = Snowflake::app()->get('gii'); $gii = Snowflake::app()->get('gii');
$connections = Snowflake::app()->db->get($dtl->get('databases', 'db')); return $gii->run($dtl->get('databases'), $dtl);
return $gii->run($connections, $dtl);
} }
} }
+3 -2
View File
@@ -114,8 +114,6 @@ class Gii
if ($this->db) { if ($this->db) {
return $this->makeByDatabases($make, $input); return $this->makeByDatabases($make, $input);
} }
var_dump($this->input->exists('databases'));
if ($this->input->exists('databases')) { if ($this->input->exists('databases')) {
$db = $this->input->get('databases', 'db'); $db = $this->input->get('databases', 'db');
$this->db = Snowflake::app()->db->get($db); $this->db = Snowflake::app()->db->get($db);
@@ -124,6 +122,8 @@ class Gii
} }
$array = []; $array = [];
foreach (Config::get('databases') as $key => $connection) { foreach (Config::get('databases') as $key => $connection) {
var_dump($connection);
$this->db = Snowflake::app()->db->get($key); $this->db = Snowflake::app()->db->get($key);
$array[$key] = $this->makeByDatabases($make, $input); $array[$key] = $this->makeByDatabases($make, $input);
@@ -137,6 +137,7 @@ class Gii
* @param $input * @param $input
* @return array * @return array
* @throws ComponentException * @throws ComponentException
* @throws Exception
*/ */
private function makeByDatabases($make, $input): array private function makeByDatabases($make, $input): array
{ {