调整HasMany类的has和hasWhere方法,取消第一个参数

This commit is contained in:
thinkphp
2017-01-16 17:36:15 +08:00
parent 04c81ca6b5
commit ff4be602c0
2 changed files with 14 additions and 14 deletions

View File

@@ -1237,9 +1237,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
{
$model = new static();
if (is_array($operator) || $operator instanceof \Closure) {
return $model->$relation()->hasWhere($model, $operator);
return $model->$relation()->hasWhere($operator);
}
return $model->$relation()->has($model, $operator, $count, $id);
return $model->$relation()->has($operator, $count, $id);
}
/**
@@ -1252,7 +1252,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
public static function hasWhere($relation, $where = [])
{
$model = new static();
return $model->$relation()->hasWhere($model, $where);
return $model->$relation()->hasWhere($where);
}
/**