diff --git a/pkg/gorm/callback.go b/pkg/gorm/callback.go index 3d40705..e3e2e6a 100644 --- a/pkg/gorm/callback.go +++ b/pkg/gorm/callback.go @@ -66,12 +66,6 @@ func RegisterDataPermissionCallback(db *gorm.DB, shopStore ShopStoreInterface) e return } - // 0. 软删除过滤(优先处理,确保所有查询都过滤已删除记录) - // 检查表是否有 deleted_at 字段,且未使用 Unscoped() - if hasDeletedAtField(tx.Statement.Schema) && !tx.Statement.Unscoped { - tx.Where("deleted_at IS NULL") - } - // 1. 检查是否跳过数据权限过滤 if skip, ok := ctx.Value(SkipDataPermissionKey).(bool); ok && skip { return