筛选指定用户点赞过的图
This commit is contained in:
		@@ -396,6 +396,7 @@ func NewSchema(config Config) (graphql.Schema, error) {
 | 
			
		||||
				},
 | 
			
		||||
			}),
 | 
			
		||||
			Args: graphql.FieldConfigArgument{
 | 
			
		||||
				"praise":        &graphql.ArgumentConfig{Type: graphql.Int, Description: "筛选图像中指定用户点赞过的"},
 | 
			
		||||
				"era":           &graphql.ArgumentConfig{Type: graphql.String, Description: "筛选图像中指定上线年份的"},
 | 
			
		||||
				"device":        &graphql.ArgumentConfig{Type: graphql.String, Description: "游戏设备"},
 | 
			
		||||
				"sort":          &graphql.ArgumentConfig{Type: graphql.String, Description: "排序方法", DefaultValue: "id"},
 | 
			
		||||
@@ -545,6 +546,14 @@ func NewSchema(config Config) (graphql.Schema, error) {
 | 
			
		||||
					query = query.Where(goqu.Ex{"article_orientation": p.Args["orientation"]})
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				// 数据库中筛选:喜欢的截图
 | 
			
		||||
				if p.Args["praise"] != nil {
 | 
			
		||||
					query = query.Join(goqu.T("web_praise"), goqu.On(
 | 
			
		||||
						goqu.I("web_images.id").Eq(goqu.I("web_praise.praise_id")),
 | 
			
		||||
						goqu.I("web_praise.user_id").Eq(p.Args["praise"]),
 | 
			
		||||
					))
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				// 数据库中筛选:游戏设备
 | 
			
		||||
				if p.Args["device"] != nil {
 | 
			
		||||
					query = query.Join(goqu.T("web_article"), goqu.On(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user