From 48066342da4ff83da8657511e28efea4e459c82a Mon Sep 17 00:00:00 2001 From: simon429 <1095568674@qq.com> Date: Tue, 26 Oct 2021 16:31:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DCRUD=E5=85=B3=E8=81=94?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E4=B8=8B=EF=BC=8C=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=99=A8=E7=94=9F=E6=88=90=E7=9A=84=E8=A2=AB?= =?UTF-8?q?=E5=85=B3=E8=81=94=E8=A1=A8=E6=A8=A1=E5=9E=8Bnamespace=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/command/Crud.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/admin/command/Crud.php b/application/admin/command/Crud.php index c707aff9b..3a7b70eda 100755 --- a/application/admin/command/Crud.php +++ b/application/admin/command/Crud.php @@ -26,7 +26,7 @@ class Crud extends Command * 受保护的系统表, crud不会生效 */ protected $systemTables = [ - 'admin', 'admin_log', 'auth_group', 'auth_group_access', 'auth_rule', + 'admin', 'admin_log', 'auth_group', 'auth_group_access', 'auth_rule', 'attachment', 'config', 'category', 'ems', 'sms', 'user', 'user_group', 'user_rule', 'user_score_log', 'user_token', ]; @@ -214,12 +214,12 @@ class Crud extends Command $force = $input->getOption('force'); //是否为本地model,为0时表示为全局model将会把model放在app/common/model中 $local = $input->getOption('local'); - + if (!$table) { throw new Exception('table name can\'t empty'); } - - + + //是否生成菜单 $menu = $input->getOption("menu"); //关联表 @@ -963,7 +963,7 @@ class Crud extends Command if ($relations) { foreach ($relations as $i => $relation) { - $relation['modelNamespace'] = $data['modelNamespace']; + $relation['modelNamespace'] = $relation['relationNamespace']; if (!is_file($relation['relationFile'])) { // 生成关联模型文件 $this->writeToFile('relationmodel', $relation, $relation['relationFile']); -- Gitee