fix distinct & count bug

This commit is contained in:
Lunny Xiao 2017-03-11 21:24:37 +08:00
parent bc97322264
commit 0d9762712b
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 1 additions and 1 deletions

View File

@ -1167,7 +1167,7 @@ func (statement *Statement) genSumSQL(bean interface{}, columns ...string) (stri
func (statement *Statement) genSelectSQL(columnStr, condSQL string) (a string) {
var distinct string
if statement.IsDistinct {
if statement.IsDistinct && !strings.HasPrefix(columnStr, "count") {
distinct = "DISTINCT "
}