|
@@ -108,16 +108,6 @@ class OrderService extends CrudService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- async afterQuery(filter, data) {
|
|
|
|
- data = JSON.parse(JSON.stringify(data));
|
|
|
|
- for (const i of data) {
|
|
|
|
- const { goods } = i;
|
|
|
|
- const buy_num_total = goods.reduce((p, n) => this.ctx.plus(p, n.goods.reduce((np, ng) => this.ctx.plus(np, ng.buy_num), 0)), 0);
|
|
|
|
- i.buy_num_total = buy_num_total;
|
|
|
|
- }
|
|
|
|
- return data;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 取消订单(支付前)
|
|
* 取消订单(支付前)
|
|
* @param {Object} body 参数体
|
|
* @param {Object} body 参数体
|
|
@@ -309,6 +299,17 @@ class OrderService extends CrudService {
|
|
}
|
|
}
|
|
return arr;
|
|
return arr;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ async afterQuery(filter, data) {
|
|
|
|
+ data = JSON.parse(JSON.stringify(data));
|
|
|
|
+ for (const i of data) {
|
|
|
|
+ const { goods } = i;
|
|
|
|
+ const buy_num_total = goods.reduce((p, n) => this.ctx.plus(p, n.goods.reduce((np, ng) => this.ctx.plus(np, ng.buy_num), 0)), 0);
|
|
|
|
+ i.buy_num_total = buy_num_total;
|
|
|
|
+ i.real_pay = _.get(i, 'pay.pay_money');
|
|
|
|
+ }
|
|
|
|
+ return data;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
module.exports = OrderService;
|
|
module.exports = OrderService;
|