From 39c0ec4c487f144d4545771fd1acaf55822df5b0 Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Thu, 28 May 2020 08:24:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../catcher/command/ModelGeneratorCommand.php | 52 ------------------- 1 file changed, 52 deletions(-) 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 <<