guhongwei %!s(int64=2) %!d(string=hai) anos
pai
achega
f49a79c20b
Modificáronse 1 ficheiros con 12 adicións e 10 borrados
  1. 12 10
      app/service/shop/goodsJoinAct.js

+ 12 - 10
app/service/shop/goodsJoinAct.js

@@ -64,13 +64,14 @@ class GoodsJoinActService extends CrudService {
   }
 
   async query(filter, { skip = 0, limit, sort, desc, projection } = {}) {
-    const { platform_act, platform_act_type, shop, shop_name, goods, goods_name, spec, spec_name, status, goods_type = 'basic' } = filter;
+    const { platform_act, platform_act_type, shop, shop_name, goods, goods_name,goods_status, spec, spec_name, status, goods_type = 'basic' } = filter;
     const mq = {};
     if (platform_act) mq.platform_act = platform_act;
     if (platform_act_type) mq.platform_act_type = platform_act_type;
     if (shop) mq.shop = shop;
     if (goods) mq.goods = goods;
     if (goods_name) mq['goods.name'] = new RegExp(goods_name);
+    if (goods_status) mq["goods.status"] = new RegExp(goods_status);
     if (spec) mq.spec = spec;
     if (spec_name) mq['spec.name'] = new RegExp(spec_name);
     if (status) mq.status = status;
@@ -108,15 +109,16 @@ class GoodsJoinActService extends CrudService {
       $project: {
         meta: 1,
         shop: 1,
-        shop_name: { $first: '$shopInfo.name' },
-        goods: '$goods._id',
-        goods_name: '$goods.name',
-        act_tags: '$goods.act_tags',
-        spec: '$spec._id',
-        spec_name: '$spec.name',
-        file: '$goods.file',
-        sell_money: { $toString: '$spec.sell_money' },
-        flow_money: { $toString: '$spec.flow_money' },
+        shop_name: { $first: "$shopInfo.name" },
+        goods: "$goods._id",
+        goods_name: "$goods.name",
+        // goods_status: "$goods.status",
+        act_tags: "$goods.act_tags",
+        spec: "$spec._id",
+        spec_name: "$spec.name",
+        file: "$goods.file",
+        sell_money: { $toString: "$spec.sell_money" },
+        flow_money: { $toString: "$spec.flow_money" },
         platform_act_type: 1,
         platform_act: 1,
         config: 1,