xormplus před 9 roky
rodič
revize
981fc07ad5
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  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 statement.IsDistinct {
 			selectSql = fmt.Sprintf("count(DISTINCT %s)", statement.ColumnStr)
+		} else {
+			selectSql = "count(*)"
 		}
-		selectSql = "count(*)"
 	}
 	return statement.genSelectSQL(selectSql, condSQL), append(statement.joinArgs, condArgs...)
 }