修正软删除withTrashed方法

This commit is contained in:
thinkphp
2016-10-25 20:42:21 +08:00
parent 2477345218
commit 535e17b1a0

View File

@@ -27,7 +27,7 @@ trait SoftDelete
public static function withTrashed() public static function withTrashed()
{ {
$model = new static(); $model = new static();
return $model->db(); return $model->db(false);
} }
/** /**
@@ -39,7 +39,7 @@ trait SoftDelete
{ {
$model = new static(); $model = new static();
$field = $model->getDeleteTimeField(); $field = $model->getDeleteTimeField();
return $model->db()->where($field, 'exp', 'is not null'); return $model->db(false)->where($field, 'exp', 'is not null');
} }
/** /**