改进数据表字段缓存生成 模型为抽象类或者 没有继承Model类 不生成字段缓存

This commit is contained in:
thinkphp
2016-09-19 18:28:07 +08:00
parent 64b4a53de7
commit fe1fd73b93

View File

@@ -84,7 +84,8 @@ class Schema extends Command
protected function buildModelSchema($class)
{
if ($class instanceof \think\Model) {
$reflect = new \ReflectionClass($class);
if (!$reflect->isAbstract() && $reflect->isSubclassOf('\think\Model')) {
$table = $class::getTable();
$dbName = $class::getConfig('database');
$content = '<?php ' . PHP_EOL . 'return ';