lrf 2 éve
szülő
commit
47eed98e11
1 módosított fájl, 4 hozzáadás és 3 törlés
  1. 4 3
      app/service/user/cashBack.js

+ 4 - 3
app/service/user/cashBack.js

@@ -15,10 +15,11 @@ class CashBackService extends CrudService {
   async computedTotal({ customer }) {
     assert(customer, '缺少用户信息');
     const res = await this.model.find({ inviter: customer });
+    console.log(res);
     const total = res.reduce((p, n) => {
-      let point = n.point;
-      if (!(n.source === '0' || n.source === '1')) point = -point;
-      return this.ctx.plus(p, point);
+      let money = n.money;
+      if (!(n.source === '0' || n.source === '1')) money = -money;
+      return this.ctx.plus(p, money);
     }, 0);
     return total;
   }