SoftDelete trait 增加trashed方法用于判断当前数据是否已经被软删除

This commit is contained in:
thinkphp
2016-08-13 21:55:54 +08:00
parent 699f268232
commit f99a0dd536

View File

@@ -4,6 +4,20 @@ namespace traits\model;
trait SoftDelete
{
/**
* 判断当前实例是否被软删除
* @access public
* @return boolean
*/
public function trashed()
{
if (!empty($this->data[static::$deleteTime])) {
return true;
}
return false;
}
/**
* 查询软删除数据
* @access public