修正软删除的destroy方法

This commit is contained in:
thinkphp
2018-11-20 15:59:00 +08:00
parent 94ecaa13c4
commit e5141a0759

View File

@@ -2,6 +2,7 @@
namespace traits\model;
use think\Collection;
use think\db\Query;
use think\Model;
@@ -111,7 +112,7 @@ trait SoftDelete
}
// 包含软删除数据
$query = self::withTrashed();
$query = (new static())->db(false);
if (is_array($data) && key($data) !== 0) {
$query->where($data);
$data = null;