fix reset colmap when counting distinct cols #2096

Merged
lunny merged 3 commits from finelog/xorm:fix_find_count_distinct_cols into master 2022-01-25 03:09:42 +00:00
Showing only changes of commit cb2ee8fafa - Show all commits

View File

@ -57,7 +57,7 @@ func (session *Session) FindAndCount(rowsSlicePtr interface{}, condiBean ...inte
if session.statement.SelectStr != "" { if session.statement.SelectStr != "" {
session.statement.SelectStr = "" session.statement.SelectStr = ""
} }
if len(session.statement.ColumnMap) > 0 { if len(session.statement.ColumnMap) > 0 && !session.statement.IsDistinct {
session.statement.ColumnMap = []string{} session.statement.ColumnMap = []string{}
} }
if session.statement.OrderStr != "" { if session.statement.OrderStr != "" {