mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
改进数据库操作join自身后出错的问题
This commit is contained in:
@@ -183,6 +183,9 @@ abstract class Builder
|
|||||||
$item = [];
|
$item = [];
|
||||||
foreach ((array) $tables as $key => $table) {
|
foreach ((array) $tables as $key => $table) {
|
||||||
if (!is_numeric($key)) {
|
if (!is_numeric($key)) {
|
||||||
|
if (strpos($key, '@think')) {
|
||||||
|
$key = strstr($key, '@think', true);
|
||||||
|
}
|
||||||
$key = $this->parseSqlTable($key);
|
$key = $this->parseSqlTable($key);
|
||||||
$item[] = $this->parseKey($key) . ' ' . $this->parseKey($table);
|
$item[] = $this->parseKey($key) . ' ' . $this->parseKey($table);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -716,6 +716,9 @@ class Query
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($alias)) {
|
if (isset($alias)) {
|
||||||
|
if (isset($this->options['alias'][$table])) {
|
||||||
|
$table = $table . '@think' . uniqid();
|
||||||
|
}
|
||||||
$table = [$table => $alias];
|
$table = [$table => $alias];
|
||||||
$this->alias($table);
|
$this->alias($table);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user