新增了返回video_author字段。

This commit is contained in:
2024-09-04 15:30:39 +08:00
parent 552a1c2323
commit 554e2a7b92
5 changed files with 40 additions and 1 deletions
+6
View File
@@ -133,6 +133,12 @@ func (r *ArticleDao) GetArticlePageSearch(req requests.GetArticlePage, page, pag
// 构建查询条件
query := global.Db.Model(&model.Article{})
// 作者
query = query.Preload("ArticleAuthor")
// 作者关联医院
query = query.Preload("ArticleAuthor.BaseHospital")
// 文章标题
if req.ArticleTitle != "" {
query = query.Where("article_title LIKE ?", "%"+req.ArticleTitle+"%")
+6
View File
@@ -133,6 +133,12 @@ func (r *VideoDao) GetVideoPageSearch(req requests.GetVideoPage, page, pageSize
// 构建查询条件
query := global.Db.Model(&model.Video{})
// 作者
query = query.Preload("VideoAuthor")
// 作者关联医院
query = query.Preload("VideoAuthor.BaseHospital")
// 文章标题
if req.VideoTitle != "" {
query = query.Where("video_title LIKE ?", "%"+req.VideoTitle+"%")