mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
改进中间表名读取
This commit is contained in:
@@ -44,10 +44,11 @@ class BelongsToMany extends Relation
|
|||||||
$this->model = $model;
|
$this->model = $model;
|
||||||
$this->foreignKey = $foreignKey;
|
$this->foreignKey = $foreignKey;
|
||||||
$this->localKey = $localKey;
|
$this->localKey = $localKey;
|
||||||
if (false === strpos($table, '\\')) {
|
if (false !== strpos($table, '\\')) {
|
||||||
$this->middle = $table;
|
|
||||||
} else {
|
|
||||||
$this->pivotName = $table;
|
$this->pivotName = $table;
|
||||||
|
$this->middle = basename(str_replace('\\', '/', $table));
|
||||||
|
} else {
|
||||||
|
$this->middle = $table;
|
||||||
}
|
}
|
||||||
$this->query = (new $model)->db();
|
$this->query = (new $model)->db();
|
||||||
$this->pivot = $this->newPivot();
|
$this->pivot = $this->newPivot();
|
||||||
|
|||||||
Reference in New Issue
Block a user