改进关联查询的全局命名范围查询

This commit is contained in:
thinkphp
2016-09-30 22:11:29 +08:00
parent 77928649d7
commit 88dfa563b3
2 changed files with 13 additions and 6 deletions

View File

@@ -661,6 +661,9 @@ class Relation
public function __call($method, $args)
{
if ($this->query) {
$class = new $this->model;
// 全局作用域
$class->baseQuery($this->query);
switch ($this->type) {
case self::HAS_MANY:
if (isset($this->where)) {