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