lrf 2 anni fa
parent
commit
4fd4941f12
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      app/service/view/goods.js

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

@@ -151,7 +151,7 @@ class GoodsService extends CrudService {
   async indexGoodsList(condition, { skip = 0, limit = 20 } = {}) {
     condition = this.dealFilter(condition);
     const pipeline = [{ $match: { status: { $ne: '0' } } }]; // { $sort: { sort: 1 } },
-    const { view_num, sell_num, sell_money, name, shop, tags } = condition;
+    const { view_num, sell_num, sell_money, name, shop, tags, act_tags } = condition;
     let sort = {};
     if (view_num) sort.view_num = parseInt(view_num);
     if (sell_num) sort.sell_num = parseInt(sell_num);
@@ -159,6 +159,7 @@ class GoodsService extends CrudService {
     if (name) pipeline.push({ $match: { name: new RegExp(name) } });
     if (shop) pipeline.push({ $match: { shop } });
     if (tags) pipeline.push({ $match: { tags: { $elemMatch: { $elemMatch: { $eq: tags } } } } });
+    if (act_tags) pipeline.push({ $match: { act_tags: { $elemMatch: { $eq: act_tags } } } });
     pipeline.push({
       $lookup: {
         from: 'actTags',