From 1786916508baa329557deb9f301846d4a7981757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 19 Jan 2021 19:01:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gii/Command.php | 4 +--- Gii/Gii.php | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Gii/Command.php b/Gii/Command.php index 13f44763..e87af8cc 100644 --- a/Gii/Command.php +++ b/Gii/Command.php @@ -32,9 +32,7 @@ class Command extends \Console\Command /** @var Gii $gii */ $gii = Snowflake::app()->get('gii'); - $connections = Snowflake::app()->db->get($dtl->get('databases', 'db')); - - return $gii->run($connections, $dtl); + return $gii->run($dtl->get('databases'), $dtl); } } diff --git a/Gii/Gii.php b/Gii/Gii.php index 6d75f857..d936e5df 100644 --- a/Gii/Gii.php +++ b/Gii/Gii.php @@ -114,8 +114,6 @@ class Gii if ($this->db) { return $this->makeByDatabases($make, $input); } - - var_dump($this->input->exists('databases')); if ($this->input->exists('databases')) { $db = $this->input->get('databases', 'db'); $this->db = Snowflake::app()->db->get($db); @@ -124,6 +122,8 @@ class Gii } $array = []; foreach (Config::get('databases') as $key => $connection) { + var_dump($connection); + $this->db = Snowflake::app()->db->get($key); $array[$key] = $this->makeByDatabases($make, $input); @@ -137,6 +137,7 @@ class Gii * @param $input * @return array * @throws ComponentException + * @throws Exception */ private function makeByDatabases($make, $input): array {