From 45701c6a5772ff34756f1d8b3b79fa0a32565963 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 14 Jan 2016 15:04:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20model=E7=B1=BB=E7=9A=84ali?= =?UTF-8?q?as=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 6 +++--- library/think/db/driver/Mysql.php | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index efa9b4e3..e38ccd3b 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -756,9 +756,6 @@ class Model $options = array_merge($this->options, $options); } - if (!empty($options['alias'])) { - $options['table'] .= ' ' . $options['alias']; - } // 记录操作的模型名称 $options['model'] = $this->name; @@ -770,6 +767,9 @@ class Model $options['table'] = $this->getTableName(); $fields = $this->getDbFields(); } + if (!empty($options['alias'])) { + $options['table'] .= ' ' . $options['alias']; + } // 字段类型验证 if (isset($options['where']) && is_array($options['where']) && !empty($fields)) { // 对数组查询条件进行字段类型检查 diff --git a/library/think/db/driver/Mysql.php b/library/think/db/driver/Mysql.php index c8bea256..6f2ba59c 100644 --- a/library/think/db/driver/Mysql.php +++ b/library/think/db/driver/Mysql.php @@ -43,7 +43,6 @@ class Mysql extends Driver * 取得数据表的字段信息 * @access public * @param $tableName - * * @return array */ public function getFields($tableName) @@ -71,9 +70,7 @@ class Mysql extends Driver /** * 取得数据库的表信息 * @access public - * * @param string $dbName - * * @return array */ public function getTables($dbName = '') @@ -107,7 +104,6 @@ class Mysql extends Driver return $key; } - /** * 随机排序 * @access protected