改进模型的字段缓存 虚拟模型不生成字段缓存

This commit is contained in:
thinkphp
2016-09-19 16:13:57 +08:00
parent fb52e8a421
commit 64b4a53de7

View File

@@ -84,6 +84,7 @@ class Schema extends Command
protected function buildModelSchema($class) protected function buildModelSchema($class)
{ {
if ($class instanceof \think\Model) {
$table = $class::getTable(); $table = $class::getTable();
$dbName = $class::getConfig('database'); $dbName = $class::getConfig('database');
$content = '<?php ' . PHP_EOL . 'return '; $content = '<?php ' . PHP_EOL . 'return ';
@@ -91,6 +92,7 @@ class Schema extends Command
$content .= var_export($info, true) . ';'; $content .= var_export($info, true) . ';';
file_put_contents(RUNTIME_PATH . 'schema' . DS . $dbName . '.' . $table . EXT, $content); file_put_contents(RUNTIME_PATH . 'schema' . DS . $dbName . '.' . $table . EXT, $content);
} }
}
protected function buildDataBaseSchema($tables, $db) protected function buildDataBaseSchema($tables, $db)
{ {