From 64b4a53de79c70ecebe74ffc1e8ed6f2294b4b09 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 19 Sep 2016 16:13:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E6=A8=A1=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=BC=93=E5=AD=98=20=E8=99=9A=E6=8B=9F?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E4=B8=8D=E7=94=9F=E6=88=90=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/console/command/optimize/Schema.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/library/think/console/command/optimize/Schema.php b/library/think/console/command/optimize/Schema.php index 2da00037..6d50d5f7 100644 --- a/library/think/console/command/optimize/Schema.php +++ b/library/think/console/command/optimize/Schema.php @@ -84,12 +84,14 @@ class Schema extends Command protected function buildModelSchema($class) { - $table = $class::getTable(); - $dbName = $class::getConfig('database'); - $content = 'getFields($table); - $content .= var_export($info, true) . ';'; - file_put_contents(RUNTIME_PATH . 'schema' . DS . $dbName . '.' . $table . EXT, $content); + if ($class instanceof \think\Model) { + $table = $class::getTable(); + $dbName = $class::getConfig('database'); + $content = 'getFields($table); + $content .= var_export($info, true) . ';'; + file_put_contents(RUNTIME_PATH . 'schema' . DS . $dbName . '.' . $table . EXT, $content); + } } protected function buildDataBaseSchema($tables, $db)