more linting

This commit is contained in:
Andrew Martin 2015-02-17 10:21:18 +11:00
parent f9638f3633
commit f37ccf2a7e
1 changed files with 22 additions and 21 deletions

View File

@ -251,52 +251,53 @@ func (s *Scope) limitSql() string {
}
func (s *Scope) topSql() string {
if s.Dialect().HasTop() && len(s.Search.Offset) == 0 {
if len(s.Search.Limit) == 0 {
func (scope *Scope) topSql() string {
if scope.Dialect().HasTop() && len(scope.Search.Offset) == 0 {
if len(scope.Search.Limit) == 0 {
return ""
} else {
return " TOP(" + s.Search.Limit + ")"
return " TOP(" + scope.Search.Limit + ")"
}
} else {
}
return ""
}
}
func (s *Scope) offsetSql() string {
if len(s.Search.Offset) == 0 {
func (scope *Scope) offsetSql() string {
if len(scope.Search.Offset) == 0 {
return ""
} else {
if s.Dialect().HasTop() {
sql := " OFFSET " + s.Search.Offset + " ROW "
if len(s.Search.Limit) > 0 {
sql += "FETCH NEXT " + s.Search.Limit + " ROWS ONLY"
if scope.Dialect().HasTop() {
sql := " OFFSET " + scope.Search.Offset + " ROW "
if len(scope.Search.Limit) > 0 {
sql += "FETCH NEXT " + scope.Search.Limit + " ROWS ONLY"
}
return sql
} else {
return " OFFSET " + s.Search.Offset
return " OFFSET " + scope.Search.Offset
}
}
}
func (s *Scope) groupSql() string {
if len(s.Search.Group) == 0 {
func (scope *Scope) groupSql() string {
if len(scope.Search.Group) == 0 {
return ""
} else {
return " GROUP BY " + s.Search.Group
return " GROUP BY " + scope.Search.Group
}
}
func (s *Scope) havingSql() string {
if s.Search.HavingCondition == nil {
func (scope *Scope) havingSql() string {
if scope.Search.HavingCondition == nil {
return ""
} else {
return " HAVING " + s.buildWhereCondition(s.Search.HavingCondition)
return " HAVING " + scope.buildWhereCondition(scope.Search.HavingCondition)
}
}
func (s *Scope) joinsSql() string {
return s.Search.Joins + " "
func (scope *Scope) joinsSql() string {
return scope.Search.Joins + " "
}
func (scope *Scope) prepareQuerySql() {