mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
注释改进
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace traits\model;
|
namespace traits\model;
|
||||||
|
|
||||||
|
use think\db\Query;
|
||||||
|
|
||||||
trait SoftDelete
|
trait SoftDelete
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -22,7 +24,7 @@ trait SoftDelete
|
|||||||
/**
|
/**
|
||||||
* 查询软删除数据
|
* 查询软删除数据
|
||||||
* @access public
|
* @access public
|
||||||
* @return \think\db\Query
|
* @return Query
|
||||||
*/
|
*/
|
||||||
public static function withTrashed()
|
public static function withTrashed()
|
||||||
{
|
{
|
||||||
@@ -34,7 +36,7 @@ trait SoftDelete
|
|||||||
/**
|
/**
|
||||||
* 只查询软删除数据
|
* 只查询软删除数据
|
||||||
* @access public
|
* @access public
|
||||||
* @return \think\db\Query
|
* @return Query
|
||||||
*/
|
*/
|
||||||
public static function onlyTrashed()
|
public static function onlyTrashed()
|
||||||
{
|
{
|
||||||
@@ -115,13 +117,13 @@ trait SoftDelete
|
|||||||
$where[$name] = ['not null', ''];
|
$where[$name] = ['not null', ''];
|
||||||
}
|
}
|
||||||
// 恢复删除
|
// 恢复删除
|
||||||
return $this->removeWhereField($this->getDeleteTimeField(true))->where($where)->update([$name => null]);
|
return $this->db(false)->removeWhereField($this->getDeleteTimeField(true))->where($where)->update([$name => null]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询默认不包含软删除数据
|
* 查询默认不包含软删除数据
|
||||||
* @access protected
|
* @access protected
|
||||||
* @param \think\db\Query $query 查询对象
|
* @param Query $query 查询对象
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function base($query)
|
protected function base($query)
|
||||||
|
|||||||
Reference in New Issue
Block a user