xormplus 7 лет назад
Родитель
Сommit
12527f1d8e
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      session_find.go

+ 7 - 0
session_find.go

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