diff --git a/api/graphql.go b/api/graphql.go index 409fadf..b889e47 100644 --- a/api/graphql.go +++ b/api/graphql.go @@ -428,17 +428,15 @@ func NewSchema(config Config) (graphql.Schema, error) { Resolve: func(p graphql.ResolveParams) (interface{}, error) { // 定义参数结构体 var args struct { - First int - Last int - After int - Before int - Text string - Interest int - Similar int - Follower int - Orientation string - Sort string - Order string + First int + Last int + After int + Before int + Text string + Interest int + Similar int + Sort string + Order string } mapstructure.Decode(p.Args, &args) @@ -452,7 +450,8 @@ func NewSchema(config Config) (graphql.Schema, error) { // 筛选条件 for _, format := range argFormat { if p.Args[format] != nil { - query.Where(goqu.Ex{fmt.Sprintf("web_images.%s = ?", format): p.Args[format]}) + fmt.Println(format, p.Args[format]) + query = query.Where(goqu.Ex{fmt.Sprintf("web_images.%s", format): p.Args[format]}) } }