改进数据库驱动的getFields方法 支持指定别名的情况 修正model类一处错误

This commit is contained in:
ThinkPHP
2013-04-30 10:45:38 +08:00
parent 7cfdde0ab7
commit 64f7e1d3ca
7 changed files with 8 additions and 3 deletions

View File

@@ -46,6 +46,7 @@ class Sqlsrv extends Driver{
* @return array
*/
public function getFields($tableName) {
list($tableName) = explode(' ', $tableName);
$result = $this->query("SELECT column_name, data_type, column_default, is_nullable
FROM information_schema.tables AS t
JOIN information_schema.columns AS c