lrf před 2 roky
rodič
revize
f3e6229a18
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      app/service/shop/goodsJoinAct.js

+ 2 - 1
app/service/shop/goodsJoinAct.js

@@ -117,7 +117,8 @@ class GoodsJoinActService extends CrudService {
         as: 'goods_prototype',
       },
     });
-    pipeline.push({ $match: { 'goods_prototype.length': { $gt: 0 } } });
+    pipeline.push({ $addFields: { gp_length: { $size: '$goods_prototype' } } });
+    pipeline.push({ $match: { gp_length: { $gt: 0 } } });
     pipeline.push({
       $project: {
         meta: 1,