跳过空值
This commit is contained in:
		@@ -642,6 +642,9 @@ func NewSchema(config Config) (graphql.Schema, error) {
 | 
			
		||||
						return nil, err
 | 
			
		||||
					}
 | 
			
		||||
					fmt.Println("Interest:", user_id, list)
 | 
			
		||||
					if len(list) == 0 {
 | 
			
		||||
						return map[string]interface{}{"list": []Image{}, "total": 0}, nil
 | 
			
		||||
					}
 | 
			
		||||
					query = query.Where(goqu.Ex{"web_images.id": goqu.Op{"in": list}}).Select("web_images.id", goqu.L(
 | 
			
		||||
						fmt.Sprintf("ROW_NUMBER() OVER(ORDER BY FIELD(%s, %s))", "web_images.id", regexp.MustCompile(`[\[\]]`).ReplaceAllString(strings.Join(strings.Fields(fmt.Sprint(list)), ", "), "")),
 | 
			
		||||
					).As("row_num"))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user