Skip to content

Commit

Permalink
改进软删除
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Feb 21, 2025
1 parent 01fd9b6 commit f3517ec
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/model/concern/SoftDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f3517ec

Please sign in to comment.