新增了返回video_author字段。
This commit is contained in:
@@ -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+"%")
|
||||
|
||||
@@ -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+"%")
|
||||
|
||||
Reference in New Issue
Block a user