From 0f24c9c580668180d9ce5d4da17ab1d3730dba23 Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Mon, 17 May 2021 08:56:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9B=E5=BB=BAtable?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E5=A4=A7=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/catcher/command/Tools/CreateTableCommand.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/extend/catcher/command/Tools/CreateTableCommand.php b/extend/catcher/command/Tools/CreateTableCommand.php index d566c12..c79c4a8 100644 --- a/extend/catcher/command/Tools/CreateTableCommand.php +++ b/extend/catcher/command/Tools/CreateTableCommand.php @@ -36,7 +36,7 @@ class CreateTableCommand extends Command FileSystem::put( CatchAdmin::moduleDirectory($module) . 'tables' . DIRECTORY_SEPARATOR . (ucwords($table) . '.php'), - $this->tableTemp($module, lcfirst($table), $form) + $this->tableTemp($module, ucwords($table), $form) ); if (! $form) { @@ -44,7 +44,7 @@ class CreateTableCommand extends Command CatchAdmin::moduleDirectory($module) . 'tables' . DIRECTORY_SEPARATOR . 'forms' . DIRECTORY_SEPARATOR . (ucwords($table) . '.php'), - $this->formTemp($module, lcfirst($table)) + $this->formTemp($module, ucwords($table)) ); } @@ -54,7 +54,9 @@ class CreateTableCommand extends Command protected function tableTemp($module, $table, $form) { - $formTemp = ! $form ? sprintf('Factory::create(\'%s\');', $table) : '[];'; + $_table = lcfirst($table); + + $formTemp = ! $form ? sprintf('Factory::create(\'%s\');', $_table) : '[];'; return <<getTable('{$table}'); + return \$this->getTable('{$_table}'); } protected function form()