This commit is contained in:
Lunny Xiao 2021-12-08 16:18:44 +08:00
parent 972c78fd6e
commit a0dffb625d
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 5 additions and 1 deletions

View File

@ -71,7 +71,11 @@ func (session *Session) FindAndCount(rowsSlicePtr interface{}, condiBean ...inte
}
// session has stored the conditions so we use `unscoped` to avoid duplicated condition.
if sliceElementType.Kind() == reflect.Struct {
return session.Unscoped().Count(reflect.New(sliceElementType).Interface())
}
return session.Unscoped().Count()
}
func (session *Session) find(rowsSlicePtr interface{}, condiBean ...interface{}) error {