1
This commit is contained in:
@@ -28,6 +28,15 @@ func (r *ArticleAuthorDao) GetArticleAuthorPreloadById(AuthorId int64) (m *model
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// GetArticleAuthorListPreloadByAuthorId 获取数据-列表-文章id
|
||||
func (r *ArticleAuthorDao) GetArticleAuthorListPreloadByAuthorId(articleId int64) (m []*model.ArticleAuthor, err error) {
|
||||
err = global.Db.Preload(clause.Associations).Where("article_id = ?", articleId).Find(&m).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// DeleteArticleAuthor 删除
|
||||
func (r *ArticleAuthorDao) DeleteArticleAuthor(tx *gorm.DB, maps interface{}) error {
|
||||
err := tx.Where(maps).Delete(&model.ArticleAuthor{}).Error
|
||||
|
||||
@@ -28,6 +28,15 @@ func (r *VideoAuthorDao) GetVideoAuthorPreloadById(authorId int64) (m *model.Vid
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// GetVideoAuthorListPreloadByVideoId 获取数据-列表-视频id
|
||||
func (r *VideoAuthorDao) GetVideoAuthorListPreloadByVideoId(videoId int64) (m []*model.VideoAuthor, err error) {
|
||||
err = global.Db.Preload(clause.Associations).Where("video_id = ?", videoId).Find(&m).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// DeleteVideoAuthor 删除
|
||||
func (r *VideoAuthorDao) DeleteVideoAuthor(tx *gorm.DB, maps interface{}) error {
|
||||
err := tx.Where(maps).Delete(&model.VideoAuthor{}).Error
|
||||
|
||||
Reference in New Issue
Block a user