refactor: 优化数据库查询构建链式调用

This commit is contained in:
2026-03-27 14:55:44 +08:00
parent 0a38df71c9
commit ac6beab363

View File

@@ -440,7 +440,7 @@ func (d *dataBase) Model(ctx context.Context, tableNameOrStruct ...any) *model {
m.Sharding(shardingConfig).ShardingValue(user.TenantId)
}
m.OmitNilData().OmitNilWhere().Hook(catchSQLHook())
m.OmitNil().OmitEmpty().Hook(catchSQLHook())
return &model{
Model: m,
}