lrf há 2 anos atrás
pai
commit
532e1becd2
1 ficheiros alterados com 3 adições e 3 exclusões
  1. 3 3
      app/service/statistics/bill.js

+ 3 - 3
app/service/statistics/bill.js

@@ -65,7 +65,7 @@ class BillService extends CrudService {
     const { shop, start, end } = query;
     const pipline = [];
     // 商店过滤&时间过滤
-    const q = { $match: { $and: [{ apply_time: { $gte: start } }, { apply_time: { $lte: end } }] } }; // 退款,退货的完成状态, status:{$in:['-1','-2']}
+    const q = { $match: { $and: [{ apply_time: { $gte: start } }, { apply_time: { $lte: end } }] } }; // 退款,退货的完成状态, status:{$in:['-1','-2']}, out_bill:{$ne:'0'}
     if (shop) q.$match.shop = shop;
     pipline.push(q);
     // 组织数据
@@ -104,7 +104,7 @@ class BillService extends CrudService {
     const { shop, start, end } = query;
     const pipline = [];
     // 商店过滤&时间过滤
-    const q = { $match: { $and: [{ pay_time: { $gte: start } }, { pay_time: { $lte: end } }] } };
+    const q = { $match: { $and: [{ pay_time: { $gte: start } }, { pay_time: { $lte: end } }] } }; // , out_bill:{$ne:'0'}
     if (shop) q.$match.shop = shop;
     pipline.push(q);
     // #region 整理数据
@@ -133,7 +133,7 @@ class BillService extends CrudService {
     const list = [];
     for (const order of orderList) {
       const o = _.cloneDeep(order);
-      const type = dictData.find(f => f.value === o.type);
+      const type = dictData.find((f) => f.value === o.type);
       const moneyDetail = this.moneyDetail(order);
       const obj = {
         _id: _.get(o, '_id'),