改进多对多关联,支持中间表模型自定义 并且定义的时候不需要使用完整表名

This commit is contained in:
thinkphp
2017-03-17 18:52:19 +08:00
parent ade630d979
commit f4629107a2
2 changed files with 28 additions and 21 deletions

View File

@@ -35,8 +35,9 @@ class Pivot extends Model
}
$this->parent = $parent;
$this->table = $table;
if (is_null($this->name)) {
$this->name = $table;
}
}
}