改进Query类的join方法

This commit is contained in:
thinkphp
2016-04-27 12:12:55 +08:00
parent fd6ca38265
commit 8cb52f60dd
2 changed files with 3 additions and 3 deletions

View File

@@ -341,7 +341,7 @@ function trace($log = '[think]', $level = 'log')
*/
function view($template = '', $vars = [])
{
return View::instance(Config::get('template'))->fetch($template, $vars);
return View::instance(Config::get('template'), Config::get('view_replace_str'))->fetch($template, $vars);
}
/**

View File

@@ -349,7 +349,7 @@ class Query
if (count($join)) {
// 有设置第二个元素则把第二元素作为表前缀
$table = (string) current($join) . $table;
} else {
} elseif (false === strpos($table, '.')) {
// 加上默认的表前缀
$table = $prefix . $table;
}
@@ -357,7 +357,7 @@ class Query
$join = trim($join);
if (0 === strpos($join, '__')) {
$table = $this->connection->parseSqlTable($join);
} elseif (false === strpos($join, '(') && !empty($prefix) && 0 !== strpos($join, $prefix)) {
} elseif (false === strpos($join, '(') && false === strpos($join, '.') && !empty($prefix) && 0 !== strpos($join, $prefix)) {
// 传入的表名中不带有'('并且不以默认的表前缀开头时加上默认的表前缀
$table = $prefix . $join;
} else {