go-gorm / gorm

The fantastic ORM library for Golang, aims to be developer friendly
https://gorm.io
MIT License
37.02k stars 3.94k forks source link

fix: merge group conds clause #7198

Open a631807682 opened 2 months ago

a631807682 commented 2 months ago

What did this pull request do?

https://gorm.io/docs/advanced_query.html#Group-Conditions

Since it is not safe to reuse a db instance, group conditions will generate duplicate where conditions when used in scope.

User Case Description

refer to https://github.com/go-gorm/gorm/issues/6148#issuecomment-1469401048 close https://github.com/go-gorm/gorm/issues/7136