From 1489abe6687e8cf40b8227294a87b9b558d098c2 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 21 Jan 2026 14:51:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8A=E6=AC=A1=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/gorm/callback.go | 6 ------ 1 file changed, 6 deletions(-) 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