We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d803f42 commit 1706475Copy full SHA for 1706475
ThinkPHP/Library/Think/Model.class.php
@@ -534,8 +534,7 @@ public function buildSql($options=array()) {
534
protected function _parseOptions($options=array()) {
535
if(is_array($options))
536
$options = array_merge($this->options,$options);
537
- // 查询过后清空sql表达式组装 避免影响下次查询
538
- $this->options = array();
+
539
if(!isset($options['table'])){
540
// 自动获取表名
541
$options['table'] = $this->getTableName();
@@ -544,7 +543,9 @@ protected function _parseOptions($options=array()) {
544
543
// 指定数据表 则重新获取字段列表 但不支持类型检测
545
$fields = $this->getDbFields();
546
}
547
-
+ // 查询过后清空sql表达式组装 避免影响下次查询
+ $this->options = array();
548
+ // 数据表别名
549
if(!empty($options['alias'])) {
550
$options['table'] .= ' '.$options['alias'];
551
0 commit comments