diff --git a/src/commands/BatchController.php b/src/commands/BatchController.php index aad4fc00..12dfaefb 100644 --- a/src/commands/BatchController.php +++ b/src/commands/BatchController.php @@ -447,9 +447,14 @@ public function actionCruds() $this->createDirectoryFromNamespace($this->crudSearchModelNamespace); foreach ($this->tables as $table) { - $table = str_replace($this->tablePrefix, '', $table); - $name = isset($this->tableNameMap[$table]) ? $this->tableNameMap[$table] : - $this->modelGenerator->generateClassName($table); + + if (isset($this->tableNameMap[$table])) { + $tmp_name = $this->tableNameMap[$table]; + } else { + $tmp_name = str_replace($this->tablePrefix, '', $table); + } + $name = $this->modelGenerator->generateClassName($tmp_name); + $params = [ 'interactive' => $this->interactive, 'overwrite' => $this->overwrite,