修正 Follower 筛选
This commit is contained in:
		@@ -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 = ? AND web_images.article_id IS NOT NULL
 | 
											WHERE web_fans.follower_id = ? AND web_images.article_category_top_id = 22
 | 
				
			||||||
					`, 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).Where("article_category_top_id = 22")
 | 
										query = query.Where("id IN ?", list)
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				for index, item := range LoadItem(p.Info.FieldASTs[0].SelectionSet.Selections) {
 | 
									for index, item := range LoadItem(p.Info.FieldASTs[0].SelectionSet.Selections) {
 | 
				
			||||||
@@ -575,8 +575,8 @@ func NewSchema(config Config) (graphql.Schema, error) {
 | 
				
			|||||||
					query = query.Preload(item)
 | 
										query = query.Preload(item)
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				// 输出
 | 
									// 输出(游戏截图分类ID为22)
 | 
				
			||||||
				if err := query.Find(&images).Error; err != nil {
 | 
									if err := query.Where("article_category_top_id = 22").Find(&images).Error; err != nil {
 | 
				
			||||||
					fmt.Println("获取图像列表失败", err)
 | 
										fmt.Println("获取图像列表失败", err)
 | 
				
			||||||
					return nil, err
 | 
										return nil, err
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user