|
@@ -159,6 +159,18 @@ class OrderDetailService extends CrudService {
|
|
|
const obj = { key: platform_act, zh: title, money: this.ctx.minus(0, discount) };
|
|
|
tarr.push(obj);
|
|
|
}
|
|
|
+ const discount_detail = _.get(total_detail, 'discount_detail', {});
|
|
|
+ const userCoupons = Object.keys(discount_detail);
|
|
|
+ if (userCoupons.length > 0) {
|
|
|
+ let dm = 0;
|
|
|
+ for (const uc_id of userCoupons) {
|
|
|
+ const detail = _.get(discount_detail, uc_id, {});
|
|
|
+ const values = Object.values(detail);
|
|
|
+ dm = values.reduce((p, n) => this.ctx.minus(p, n), dm);
|
|
|
+ }
|
|
|
+ tarr.push({ key: 'coupons', zh: '优惠券优惠', money: dm });
|
|
|
+ }
|
|
|
+
|
|
|
return tarr;
|
|
|
}
|
|
|
|