This commit is contained in:
Lunny Xiao 2016-12-10 10:04:48 +08:00
parent 2597ab2401
commit dc3618b2f7
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 2 additions and 1 deletions

View File

@ -1152,8 +1152,9 @@ func (statement *Statement) genCountSQL(bean interface{}) (string, []interface{}
if len(selectSql) <= 0 {
if statement.IsDistinct {
selectSql = fmt.Sprintf("count(DISTINCT %s)", statement.ColumnStr)
} else {
selectSql = "count(*)"
}
selectSql = "count(*)"
}
return statement.genSelectSQL(selectSql, condSQL), append(statement.joinArgs, condArgs...)
}