lrf 2 年之前
父节点
当前提交
8fcc0649da
共有 1 个文件被更改,包括 1 次插入1 次删除
  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' } } });