作者 庄敏学

文章排序

@@ -136,6 +136,8 @@ func (repository *ArticleRepository) Find(ctx context.Context, conn transaction. @@ -136,6 +136,8 @@ func (repository *ArticleRepository) Find(ctx context.Context, conn transaction.
136 default: 136 default:
137 tx = tx.Order("created_at desc") 137 tx = tx.Order("created_at desc")
138 } 138 }
  139 + } else {
  140 + tx = tx.Order("created_at desc")
139 } 141 }
140 if v, ok := queryOptions["ids"]; ok { 142 if v, ok := queryOptions["ids"]; ok {
141 tx = tx.Where("id in (?)", v) 143 tx = tx.Where("id in (?)", v)