From f3517ec6f244a485e38f5305aa281141a22ac813 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 21 Feb 2025 14:53:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E8=BD=AF=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/model/concern/SoftDelete.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/model/concern/SoftDelete.php b/src/model/concern/SoftDelete.php index ec370824..1e1933d0 100644 --- a/src/model/concern/SoftDelete.php +++ b/src/model/concern/SoftDelete.php @@ -27,9 +27,15 @@ */ trait SoftDelete { - public function getQuery(): Query + /** + * 获取查询对象 + * + * @param array|null $scope 设置不使用的全局查询范围 + * @return Query + */ + public function getQuery(array | null $scope = []): Query { - $query = parent::getQuery(); + $query = parent::getQuery($scope); $this->withNoTrashed($query); return $query;