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