改进Query类的getTableInfo方法 支持对表名的特殊字符定义

This commit is contained in:
thinkphp
2016-05-30 16:28:53 +08:00
parent 7d72c6743f
commit d36903bddc

View File

@@ -1202,10 +1202,14 @@ class Query
if (is_array($tableName)) {
$tableName = key($tableName) ?: current($tableName);
}
if (strpos($tableName, ',')) {
// 多表不获取字段信息
return false;
} else {
$tableName = $this->connection->parseSqlTable($tableName);
}
$guid = md5($tableName);
if (!isset($_info[$guid])) {
$info = $this->connection->getFields($tableName);