改进join关联自身的问题

This commit is contained in:
thinkphp
2017-12-18 16:46:06 +08:00
parent caacea97e2
commit e2a77ff2f3

View File

@@ -733,7 +733,10 @@ class Query
if (isset($alias) && $table != $alias) {
if (isset($this->options['alias'][$table])) {
$table = $table . '@think' . uniqid();
} elseif ($this->gettable() == $table) {
$table = $table . '@think' . uniqid();
}
$table = [$table => $alias];
$this->alias($table);
}