修复CRUD关联模型下,自定义控制器生成的被关联表模型namespace错误

pull/371/head
simon429 2021-10-26 16:31:38 +08:00
parent ecdaa81a8d
commit 48066342da
1 changed files with 5 additions and 5 deletions

View File

@ -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']);