lrf %!s(int64=2) %!d(string=hai) anos
pai
achega
8fcc0649da
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/service/view/goods.js

+ 1 - 1
app/service/view/goods.js

@@ -44,7 +44,7 @@ class GoodsService extends CrudService {
     if (view_num) sort.view_num = view_num;
     if (sell_num) sort.sell_num = sell_num;
     if (sell_money) sort.sell_money = sell_money;
-    if (name) pipline.push({ $match: { name } });
+    if (name) pipline.push({ $match: { name: new RegExp(name) } });
     if (shop) pipline.push({ $match: { shop } });
 
     pipline.push({ $addFields: { goods_id: { $toString: '$_id' } } });