mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-05 22:52:49 +08:00
SoftDelete trait 增加trashed方法用于判断当前数据是否已经被软删除
This commit is contained in:
@@ -4,6 +4,20 @@ namespace traits\model;
|
|||||||
|
|
||||||
trait SoftDelete
|
trait SoftDelete
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断当前实例是否被软删除
|
||||||
|
* @access public
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function trashed()
|
||||||
|
{
|
||||||
|
if (!empty($this->data[static::$deleteTime])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询软删除数据
|
* 查询软删除数据
|
||||||
* @access public
|
* @access public
|
||||||
|
|||||||
Reference in New Issue
Block a user