1
This commit is contained in:
+3
-3
@@ -68,7 +68,7 @@ class Gii
|
||||
$this->input = $input;
|
||||
$this->db = $db;
|
||||
|
||||
$make = $this->input->getArgument('action');
|
||||
$make = $this->input->getOption('make');
|
||||
if (empty($make)) {
|
||||
throw new Exception('构建类型不能为空~');
|
||||
}
|
||||
@@ -120,8 +120,8 @@ class Gii
|
||||
private function makeByDatabases($make, InputInterface $input): array
|
||||
{
|
||||
$redis = Kiri::getDi()->get(Redis::class);
|
||||
if ($input->hasArgument('name')) {
|
||||
$this->tableName = $input->getArgument('name');
|
||||
if ($input->hasOption('name')) {
|
||||
$this->tableName = $input->getOption('name');
|
||||
$redis->del('column:' . $this->tableName);
|
||||
}
|
||||
return match ($make) {
|
||||
|
||||
@@ -52,12 +52,12 @@ class GiiCommand extends Command
|
||||
$gii = Kiri::app()->get('gii');
|
||||
|
||||
$connections = Kiri::app()->get('db');
|
||||
if (($db = $input->getArgument('databases')) != null) {
|
||||
if (($db = $input->getOption('databases')) != null) {
|
||||
$gii->run($connections->get($db), $input);
|
||||
return 1;
|
||||
}
|
||||
|
||||
$action = $input->getArgument('make');
|
||||
$action = $input->getOption('make');
|
||||
if (!in_array($action, ['model', 'controller'])) {
|
||||
$gii->run(null, $input);
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user