@@ -363,9 +363,10 @@ func (q *Query) ExcludeColumn(columns ...string) *Query {
363363// AppendColumn appends column to the list of default columns if they weren't set,
364364// while Column method overrides defaults
365365func (q * Query ) AppendColumn (columns ... string ) * Query {
366+ t := q .tableModel .Table ()
366367 if q .columns == nil {
367- for _ , f := range q . tableModel . Table () .Fields {
368- q .columns = append (q .columns , fieldAppender {f .SQLName })
368+ for _ , f := range t .Fields {
369+ q .columns = append (q .columns , fieldAppender {fmt . Sprintf ( "%s.%s" , t . Alias , f .SQLName ) })
369370 }
370371 }
371372 return q .Column (columns ... )
@@ -374,9 +375,10 @@ func (q *Query) AppendColumn(columns ...string) *Query {
374375// AppendColumnExpr appends column expression to the list of default columns if they weren't set,
375376// while ColumnExpr method overrides defaults
376377func (q * Query ) AppendColumnExpr (expr string , params ... interface {}) * Query {
378+ t := q .tableModel .Table ()
377379 if q .columns == nil {
378- for _ , f := range q . tableModel . Table () .Fields {
379- q .columns = append (q .columns , fieldAppender {f .SQLName })
380+ for _ , f := range t .Fields {
381+ q .columns = append (q .columns , fieldAppender {fmt . Sprintf ( "%s.%s" , t . Alias , f .SQLName ) })
380382 }
381383 }
382384 return q .ColumnExpr (expr , params ... )
0 commit comments