修改文件:thinkphp/library/think/db/Query.php
protected function getJoinTable($join, &$alias = null) { // 传入的表名为数组 if (is_array($join)) { $table = $join; $alias = array_shift($join); } else { $join = trim($join); if (false !== strpos($join, '(')) { // 使用子查询 $table = $join; } else { $prefix = $this->prefix; if (strpos($join, ' ')) { // 使用别名 list($table, $alias) = explode(' ', $join); } else { $table = $join; if (false === strpos($join, '.') && 0 !== strpos($join, '__')) { $alias = $join; } } //改(下面已注释)开始 if ((($prefix && 0 !== strpos($table, $prefix)) || !$prefix) && false === strpos($table, '.') && 0 !== strpos($table, '__')) { $table = $this->getTable($table); } //改结束 /*if ($prefix && false === strpos($table, '.') && 0 !== strpos($table, $prefix) && 0 !== strpos($table, '__')) { $table = $this->getTable($table); }*/ } if (isset($alias) && $table != $alias) { $table = [$table => $alias]; } } return $table; }