animeic 2 years ago
parent
commit
f696f8f793
3 changed files with 3 additions and 3 deletions
  1. 1 1
      boxcost/api/craft.go
  2. 1 1
      boxcost/api/material.go
  3. 1 1
      boxcost/api/product.go

+ 1 - 1
boxcost/api/craft.go

@@ -88,7 +88,7 @@ func GetCrafts(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 	}
 	if _norm, ok := query["norm"]; ok {
 		delete(query, "norm")
-		query["name"] = bson.M{"$regex": _norm.(string)}
+		query["norm"] = bson.M{"$regex": _norm.(string)}
 	}
 
 	option := &repo.PageSearchOptions{

+ 1 - 1
boxcost/api/material.go

@@ -88,7 +88,7 @@ func GetMaterials(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 	}
 	if _norm, ok := query["norm"]; ok {
 		delete(query, "norm")
-		query["name"] = bson.M{"$regex": _norm.(string)}
+		query["norm"] = bson.M{"$regex": _norm.(string)}
 	}
 
 	option := &repo.PageSearchOptions{

+ 1 - 1
boxcost/api/product.go

@@ -36,7 +36,7 @@ func Product(r *GinRouter) {
 			}
 			if _norm, ok := query["norm"]; ok {
 				delete(query, "norm")
-				query["name"] = bson.M{"$regex": _norm.(string)}
+				query["norm"] = bson.M{"$regex": _norm.(string)}
 			}
 
 			return query