Fixed limit and offset for subquery
This commit is contained in:
parent
30f2304e9d
commit
edbcbe3126
2
main.go
2
main.go
@ -188,7 +188,7 @@ func (s *DB) QueryExpr(alias ...string) *expr {
|
|||||||
|
|
||||||
// SubQuery returns the query as sub query
|
// SubQuery returns the query as sub query
|
||||||
func (s *DB) SubQuery() *expr {
|
func (s *DB) SubQuery() *expr {
|
||||||
if s.search.limit == nil && s.search.offset == nil {
|
if (s.search.limit == nil || s.search.limit == -1) && (s.search.offset == nil || s.search.offset == -1) {
|
||||||
s = s.Order(nil, true)
|
s = s.Order(nil, true)
|
||||||
}
|
}
|
||||||
scope := s.NewScope(s.Value)
|
scope := s.NewScope(s.Value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user