-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
11 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
// +---------------------------------------------------------------------- | ||
// | Author: liu21st <[email protected]> | ||
// +---------------------------------------------------------------------- | ||
declare(strict_types=1); | ||
declare (strict_types = 1); | ||
|
||
namespace think\model\concern; | ||
|
||
|
@@ -26,13 +26,6 @@ | |
*/ | ||
trait SoftDelete | ||
{ | ||
/** | ||
* 软删除字段默认值 | ||
* | ||
* @var mixed | ||
*/ | ||
protected $defaultSoftDelete; | ||
|
||
public function db($scope = []): Query | ||
{ | ||
$query = parent::db($scope); | ||
|
@@ -92,7 +85,7 @@ public function delete(): bool | |
return false; | ||
} | ||
|
||
$name = $this->getDeleteTimeField(); | ||
$name = $this->getDeleteTimeField(); | ||
$force = $this->isForce(); | ||
|
||
if ($name && !$force) { | ||
|
@@ -152,7 +145,7 @@ public static function destroy($data, bool $force = false): bool | |
$query->where($data); | ||
$data = []; | ||
} elseif ($data instanceof \Closure) { | ||
call_user_func_array($data, [&$query]); | ||
call_user_func_array($data, [ &$query]); | ||
$data = []; | ||
} | ||
|
||
|
@@ -206,7 +199,7 @@ public function restore(array $where = []): bool | |
* | ||
* @return string|false | ||
*/ | ||
public function getDeleteTimeField(bool $read = false): bool|string | ||
public function getDeleteTimeField(bool $read = false): bool | string | ||
{ | ||
$field = property_exists($this, 'deleteTime') && isset($this->deleteTime) ? $this->deleteTime : 'delete_time'; | ||
|
||
|