|
@@ -22,8 +22,8 @@ class CashBackService extends CrudService {
|
|
|
const min = this.ctx.multiply(rd, this.ctx.multiply(24, 60));
|
|
|
let total = 0;
|
|
|
for (const i of res) {
|
|
|
- const { source, money } = i;
|
|
|
- const sn = parseInt(source);
|
|
|
+ const { status, money } = i;
|
|
|
+ const sn = parseInt(status);
|
|
|
if (sn >= 0) total = this.ctx.plus(total, money);
|
|
|
else total = this.ctx.minus(total, money);
|
|
|
}
|
|
@@ -31,10 +31,10 @@ class CashBackService extends CrudService {
|
|
|
// 上面总价包含了提现金额
|
|
|
// 下面计算的金额是可以提现的金额 提现总金额 - 提现金额
|
|
|
let canGet = 0;
|
|
|
- const inBill = res.filter(f => parseInt(f.source) >= 0);
|
|
|
- const outBill = res.filter(f => parseInt(f.source) < 0);
|
|
|
- const getOutBill = res.filter(f => f.source === '-1');
|
|
|
- const outBillMoney = getOutBill.reduce((p, n) => this.ctx.plus(p, n.money), 0);
|
|
|
+ const inBill = res.filter(f => parseInt(f.status) >= 0);
|
|
|
+ const outBill = res.filter(f => parseInt(f.status) < 0);
|
|
|
+ // const getOutBill = res.filter(f => f.status === '-1');
|
|
|
+ // const outBillMoney = getOutBill.reduce((p, n) => this.ctx.plus(p, n.money), 0);
|
|
|
for (const i of inBill) {
|
|
|
const cAt = _.get(i, 'time');
|
|
|
const m = moment().diff(cAt, 'm');
|
|
@@ -49,7 +49,7 @@ class CashBackService extends CrudService {
|
|
|
canGet = this.ctx.plus(canGet, cg);
|
|
|
}
|
|
|
}
|
|
|
- canGet = this.ctx.minus(canGet, outBillMoney);
|
|
|
+ // canGet = this.ctx.minus(canGet, outBillMoney);
|
|
|
return { total, canGet };
|
|
|
}
|
|
|
/**
|