过滤非文章图片

This commit is contained in:
2024-11-08 09:18:36 +08:00
parent a541d2b263
commit 00abb0e504

View File

@@ -485,7 +485,7 @@ func NewSchema(config Config) (graphql.Schema, error) {
SELECT JSON_ARRAYAGG(web_images.id) AS json_result SELECT JSON_ARRAYAGG(web_images.id) AS json_result
FROM web_fans FROM web_fans
INNER JOIN web_images ON web_images.user_id = web_fans.blogger_id INNER JOIN web_images ON web_images.user_id = web_fans.blogger_id
WHERE web_fans.follower_id = ? WHERE web_fans.follower_id = ? AND web_images.article_id IS NOT NULL
`, args.Follower).Scan(&item).Error; err != nil { `, args.Follower).Scan(&item).Error; err != nil {
fmt.Println("获取关注列表失败", err) fmt.Println("获取关注列表失败", err)
return nil, err return nil, err
@@ -567,7 +567,7 @@ func NewSchema(config Config) (graphql.Schema, error) {
// 存在外部筛选条件 // 存在外部筛选条件
if len(id_list) > 0 && len(list) > 0 { if len(id_list) > 0 && len(list) > 0 {
query = query.Where("id IN ?", list) query = query.Where("id IN ?", list).Where("article_id IS NOT NULL")
} }
for index, item := range LoadItem(p.Info.FieldASTs[0].SelectionSet.Selections) { for index, item := range LoadItem(p.Info.FieldASTs[0].SelectionSet.Selections) {