diff --git a/api/graphql.go b/api/graphql.go index cf28cda..3332c03 100644 --- a/api/graphql.go +++ b/api/graphql.go @@ -499,12 +499,11 @@ func NewSchema(config Config) (graphql.Schema, error) { item = append(item, num) } - query = query.Where("web_images.id IN (?)", item) + if len(item) == 0 { + return map[string]interface{}{"list": []Image{}, "total": 0}, nil + } - //id_list = append(id_list, item) - //if len(id_list) == 0 { - // return map[string]interface{}{"list": []Image{}, "total": 0}, nil - //} + query = query.Where("web_images.id IN (?)", item) } // 筛选:相似图像