forked from mirror/gorm
include order by for group SQL
This commit is contained in:
parent
2a46856d52
commit
073fa4dc85
|
@ -213,7 +213,7 @@ func (scope *Scope) selectSql() string {
|
|||
return "*"
|
||||
}
|
||||
sql := scope.buildSelectQuery(scope.Search.selects)
|
||||
scope.Search.countingQuery = hasCountRegexp.MatchString(sql)
|
||||
scope.Search.countingQuery = (len(scope.Search.group) == 0) && hasCountRegexp.MatchString(sql)
|
||||
return scope.buildSelectQuery(scope.Search.selects)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue