This commit is contained in:
2021-12-12 02:45:39 +08:00
parent 8229395e6d
commit 6e5b545a1e
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -68,7 +68,7 @@ class Gii
$this->input = $input; $this->input = $input;
$this->db = $db; $this->db = $db;
$make = $this->input->getArgument('action'); $make = $this->input->getOption('make');
if (empty($make)) { if (empty($make)) {
throw new Exception('构建类型不能为空~'); throw new Exception('构建类型不能为空~');
} }
@@ -120,8 +120,8 @@ class Gii
private function makeByDatabases($make, InputInterface $input): array private function makeByDatabases($make, InputInterface $input): array
{ {
$redis = Kiri::getDi()->get(Redis::class); $redis = Kiri::getDi()->get(Redis::class);
if ($input->hasArgument('name')) { if ($input->hasOption('name')) {
$this->tableName = $input->getArgument('name'); $this->tableName = $input->getOption('name');
$redis->del('column:' . $this->tableName); $redis->del('column:' . $this->tableName);
} }
return match ($make) { return match ($make) {
+2 -2
View File
@@ -52,12 +52,12 @@ class GiiCommand extends Command
$gii = Kiri::app()->get('gii'); $gii = Kiri::app()->get('gii');
$connections = Kiri::app()->get('db'); $connections = Kiri::app()->get('db');
if (($db = $input->getArgument('databases')) != null) { if (($db = $input->getOption('databases')) != null) {
$gii->run($connections->get($db), $input); $gii->run($connections->get($db), $input);
return 1; return 1;
} }
$action = $input->getArgument('make'); $action = $input->getOption('make');
if (!in_array($action, ['model', 'controller'])) { if (!in_array($action, ['model', 'controller'])) {
$gii->run(null, $input); $gii->run(null, $input);
return 1; return 1;