Fix bug
This commit is contained in:
parent
972c78fd6e
commit
a0dffb625d
|
@ -71,9 +71,13 @@ 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 {
|
||||
defer session.resetStatement()
|
||||
if session.statement.LastError != nil {
|
||||
|
|
Loading…
Reference in New Issue