🎨 获取文章列表新增排序&优化批量上传文章
This commit is contained in:
@@ -55,7 +55,7 @@ func (ArticleService) GetArticleList(pageInfo request.GetList) (list []article.A
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = db.Limit(limit).Offset(offset).Find(&list).Error
|
||||
err = db.Limit(limit).Offset(offset).Order("created_at desc").Find(&list).Error
|
||||
return
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ func (s ArticleService) BulkUpload(p request.BulkUpload) (err error) {
|
||||
publishTime, _ := time.ParseInLocation("2006-01-02 15:04:05", p.PublishTime, loc)
|
||||
|
||||
articles = append(articles, article.Article{
|
||||
Title: p.Title,
|
||||
Title: teacher.NickName + "--" + p.Title,
|
||||
Desc: p.Desc,
|
||||
CategoryId: p.CategoryId,
|
||||
TeacherId: int(teacher.ID),
|
||||
|
Reference in New Issue
Block a user