lrf 2 years ago
parent
commit
589770a0f6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/service/view/order.js

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

@@ -46,8 +46,8 @@ class OrderService extends CrudService {
     ];
     pipeline.push(...step2);
     pipeline.push({ $unwind: '$data' });
-    pipeline.push({ $match: { customer } });
     pipeline.push({ $replaceRoot: { newRoot: '$data' } });
+    pipeline.push({ $match: { customer } });
     const qp = _.cloneDeep(pipeline);
     qp.push({ $sort: { 'meta.createdAt': -1 } });
     if (skip && limit) qp.push({ $skip: parseInt(skip) }, { $limit: parseInt(limit) });