Remove other select conditions for count

This commit is contained in:
Jinzhu 2015-02-22 22:40:12 +08:00
parent 38938f299f
commit 49a33dd5d0
1 changed files with 3 additions and 1 deletions

View File

@ -370,7 +370,9 @@ func (scope *Scope) pluck(column string, value interface{}) *Scope {
} }
func (scope *Scope) count(value interface{}) *Scope { func (scope *Scope) count(value interface{}) *Scope {
scope.Search = scope.Search.clone().selects("count(*)") scope.Search = scope.Search.clone()
scope.Search.Selects = []map[string]interface{}{}
scope.Search.selects("count(*)")
scope.Err(scope.row().Scan(value)) scope.Err(scope.row().Scan(value))
return scope return scope
} }