lrf 2 năm trước cách đây
mục cha
commit
31611da2aa
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 9 0
      app/service/shop/shopInBill.js

+ 9 - 0
app/service/shop/shopInBill.js

@@ -93,6 +93,15 @@ class ShopInBillService extends CrudService {
     canGet = this.ctx.minus(canGet, outBillMoney);
     return { total, canGet };
   }
+
+  async afterQuery(filter, data) {
+    for (const i of data) {
+      const { source } = i;
+      if (parseInt(source) >= 0) i.receipts = `+${i.receipts}`;
+      else i.receipts = `-${i.receipts}`;
+    }
+    return data;
+  }
 }
 
 module.exports = ShopInBillService;