unset ORDER BY for search count queries

This commit is contained in:
Gani Georgiev
2022-09-22 20:18:17 +03:00
parent 0b2eb24c6f
commit 3d36ff7e96
2 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -199,7 +199,7 @@ func (s *Provider) Exec(items any) (*Result, error) {
// count
var totalCount int64
countQuery := modelsQuery
countQuery.Distinct(false).Select("COUNT(*)")
countQuery.Distinct(false).Select("COUNT(*)").OrderBy([]string{}...) // unset ORDER BY statements
if s.countColumn != "" {
countQuery.Select("COUNT(DISTINCT(" + s.countColumn + "))")
}