xormplus %!s(int64=9) %!d(string=hai) anos
pai
achega
981fc07ad5
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      statement.go

+ 2 - 1
statement.go

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