lrf 2 年之前
父節點
當前提交
b590a46a46
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/service/view/goods.js

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

@@ -46,7 +46,7 @@ class GoodsService extends CrudService {
     if (sell_money) sort.sell_money = sell_money;
     if (name) pipline.push({ $match: { name: new RegExp(name) } });
     if (shop) pipline.push({ $match: { shop } });
-    if (tags) pipline.push({ tags: { $elemMatch: { $elemMatch: { $eq: tags } } } });
+    if (tags) pipline.push({ $match: { tags: { $elemMatch: { $elemMatch: { $eq: tags } } } } });
 
     pipline.push({ $addFields: { goods_id: { $toString: '$_id' } } });
     // 表关联