diff --git a/extend/catcher/command/ModelGeneratorCommand.php b/extend/catcher/command/ModelGeneratorCommand.php index b734b65..599ed54 100644 --- a/extend/catcher/command/ModelGeneratorCommand.php +++ b/extend/catcher/command/ModelGeneratorCommand.php @@ -58,56 +58,4 @@ class ModelGeneratorCommand extends Command $output->error(sprintf('%s Create Failed!', $modelFile)); } } - - - - private function getTableFields($table): array - { - $fields = Db::query('show full columns from ' . - config('database.connections.mysql.prefix') . $table); - - $new = []; - - foreach ($fields as $field) { - $new[$field['Field']] = $field['Comment']; - } - - return $new; - } - - private function generateFields($fields) - { - $f = ''; - foreach ($fields as $field => $comment) { - $f .= sprintf("'%s', // %s" . "\r\n\t\t", $field, $comment); - } - - return rtrim($f, "\r\n\t\t"); - } - - private function replaceContent(array $replace) - { - return str_replace([ - '{Module}', '{Class}', '{Name}', '{Field}' - ], $replace, $this->content()); - } - - private function content() - { - return <<