fix bug on findandcount (#852)

This commit is contained in:
Lunny Xiao 2018-02-24 16:12:53 +08:00 committed by GitHub
parent cea778734c
commit a4378c8abd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -47,6 +47,9 @@ func (session *Session) FindAndCount(rowsSlicePtr interface{}, condiBean ...inte
}
sliceElementType := sliceValue.Type().Elem()
if sliceElementType.Kind() == reflect.Ptr {
sliceElementType = sliceElementType.Elem()
}
session.autoResetStatement = true
return session.Count(reflect.New(sliceElementType).Interface())