mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
软删除
This commit is contained in:
@@ -42,7 +42,8 @@ trait SoftDelete
|
||||
{
|
||||
$model = new static();
|
||||
$field = $model->getDeleteTimeField(true);
|
||||
return $model->db(false)->useSoftDelete($field, ['not null', '']);
|
||||
return $model->db(false)
|
||||
->useSoftDelete($field, ['not null', '']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,7 +117,10 @@ trait SoftDelete
|
||||
$where[$pk] = $this->getData($pk);
|
||||
}
|
||||
// 恢复删除
|
||||
return $this->db(false)->useSoftDelete($name, ['not null', ''])->where($where)->update([$name => null]);
|
||||
return $this->db(false)
|
||||
->useSoftDelete($name, ['not null', ''])
|
||||
->where($where)
|
||||
->update([$name => null]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user