From ca7ff275c61c636cf4d3ed8f3d0b3e510a479eac Mon Sep 17 00:00:00 2001 From: satori Date: Mon, 11 Nov 2024 02:17:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E8=97=8F=E5=A4=B9=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E6=88=AA=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/graphql.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/graphql.go b/api/graphql.go index 9f1cb77..7780b0d 100644 --- a/api/graphql.go +++ b/api/graphql.go @@ -409,6 +409,7 @@ func NewSchema(config Config) (graphql.Schema, error) { }, }), Args: graphql.FieldConfigArgument{ + "explorer_id": &graphql.ArgumentConfig{Type: graphql.Int, Description: "筛选图像中指定收藏夹的"}, "collect_id": &graphql.ArgumentConfig{Type: graphql.Int, Description: "筛选图像中指定收藏夹的"}, "collect": &graphql.ArgumentConfig{Type: graphql.Int, Description: "筛选图像中指定用户收藏过的"}, "praise": &graphql.ArgumentConfig{Type: graphql.Int, Description: "筛选图像中指定用户点赞过的"}, @@ -592,6 +593,14 @@ func NewSchema(config Config) (graphql.Schema, error) { )) } + // 数据库中筛选:收藏夹中的截图 + if p.Args["explorer_id"] != nil { + query = query.Join(goqu.T("web_collect"), goqu.On( + goqu.I("web_images.id").Eq(goqu.I("web_collect.image_id")), + goqu.I("web_collect.explorer_id").Eq(p.Args["explorer_id"]), + )) + } + // 数据库中筛选:游戏设备 if p.Args["device"] != nil { query = query.Join(goqu.T("web_article"), goqu.On(