lrf 2 gadi atpakaļ
vecāks
revīzija
b590a46a46
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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 (sell_money) sort.sell_money = sell_money;
     if (name) pipline.push({ $match: { name: new RegExp(name) } });
     if (name) pipline.push({ $match: { name: new RegExp(name) } });
     if (shop) pipline.push({ $match: { shop } });
     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' } } });
     pipline.push({ $addFields: { goods_id: { $toString: '$_id' } } });
     // 表关联
     // 表关联