修复上次错误的提交
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 4m20s

This commit is contained in:
2026-01-21 14:51:08 +08:00
parent 3b1fd91709
commit 1489abe668

View File

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