变更
This commit is contained in:
@@ -117,8 +117,8 @@ class Gii
|
||||
*/
|
||||
private function makeByDatabases($make, InputInterface $input): array
|
||||
{
|
||||
if ($input->hasOption('name')) {
|
||||
$this->tableName = $input->getOption('name');
|
||||
if ($input->hasOption('table')) {
|
||||
$this->tableName = $input->getOption('table');
|
||||
}
|
||||
return match ($make) {
|
||||
'controller' => $this->getTable(1, 0),
|
||||
@@ -283,8 +283,8 @@ class Gii
|
||||
if (in_array(strtoupper($_val['Field']), $this->keyword)) {
|
||||
throw new Exception('You can not use keyword "' . $_val['Field'] . '" as field at table "' . $tableName . '"');
|
||||
}
|
||||
array_push($visible, $this->createVisible($_val['Field']));
|
||||
array_push($fields, $_val);
|
||||
$visible[] = $this->createVisible($_val['Field']);
|
||||
$fields[] = $_val;
|
||||
$res[] = $this->createSetFunc($_val['Field'], $_val['Comment']);
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -38,9 +38,9 @@ class GiiCommand extends Command
|
||||
$this->service = Kiri::getDi()->get(LocalService::class);
|
||||
$this->setName('sw:gii')
|
||||
->addOption('make', 'm', InputArgument::OPTIONAL)
|
||||
->addOption('name', 't', InputArgument::OPTIONAL)
|
||||
->addOption('databases', 'd', InputArgument::OPTIONAL)
|
||||
->setDescription('./snowflake sw:gii make=model|controller|task|interceptor|limits|middleware name=xxxx');
|
||||
->addOption('table', 't', InputArgument::OPTIONAL)
|
||||
->addOption('database', 'd', InputArgument::OPTIONAL)
|
||||
->setDescription('php kiri.php sw:gii --table u_user --database users --make model');
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class GiiCommand extends Command
|
||||
try {
|
||||
/** @var Gii $gii */
|
||||
$gii = $this->service->get('gii');
|
||||
if (($db = $input->getOption('databases')) != null) {
|
||||
if (($db = $input->getOption('database')) != null) {
|
||||
$gii->run($this->service->get($db), $input);
|
||||
} else {
|
||||
$action = $input->getOption('make');
|
||||
|
||||
Reference in New Issue
Block a user