取消关联类无效的alias参数 仅morphTo关联保留 用于设置多态别名

This commit is contained in:
thinkphp
2017-01-16 23:03:12 +08:00
parent 908de8f4ee
commit 1568af03d8
9 changed files with 31 additions and 44 deletions

View File

@@ -31,16 +31,14 @@ class BelongsToMany extends Relation
* @param string $table 中间表名
* @param string $foreignKey 关联模型外键
* @param string $localKey 当前模型关联键
* @param array $alias 别名定义
*/
public function __construct(Model $parent, $model, $table, $foreignKey, $localKey, $alias = [])
public function __construct(Model $parent, $model, $table, $foreignKey, $localKey)
{
$this->parent = $parent;
$this->model = $model;
$this->foreignKey = $foreignKey;
$this->localKey = $localKey;
$this->middle = $table;
$this->alias = $alias;
$this->query = (new $model)->db();
}