From f18766c20a6fea1e11f5123ad8f7b1d5de1d3a31 Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Mon, 22 Jun 2020 15:19:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=8C=83=E5=9B=B4=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/catcher/traits/db/ScopeTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extend/catcher/traits/db/ScopeTrait.php b/extend/catcher/traits/db/ScopeTrait.php index 4eb097d..3a7dd64 100644 --- a/extend/catcher/traits/db/ScopeTrait.php +++ b/extend/catcher/traits/db/ScopeTrait.php @@ -23,7 +23,7 @@ trait ScopeTrait */ public function scopeCreator($query) { - if (in_array('creator_id', $this->field)) { + if (property_exists($this, 'field') && in_array('creator_id', $this->field)) { return $query->addSelectSub(function () { $user = app(Users::class); return $user->whereColumn($this->getTable() . '.creator_id', $user->getTable() . '.id')