|
@@ -36,13 +36,11 @@ func DeleteMaterial(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
|
|
|
func MaterialList(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
page, size, query := UtilQueryPageSize(c)
|
|
|
-
|
|
|
- name := c.Query("name")
|
|
|
if v, ok := query["name"]; ok {
|
|
|
- name = v.(string)
|
|
|
+ name := v.(string)
|
|
|
if len(name) > 0 {
|
|
|
delete(query, "name")
|
|
|
- query["name"] = bson.M{"$regex": name, "$options": "$i"}
|
|
|
+ query["attributes.name"] = bson.M{"$regex": name, "$options": "$i"}
|
|
|
}
|
|
|
}
|
|
|
|