|
@@ -88,6 +88,7 @@ class AfterSaleService extends CrudService {
|
|
// 3.修改数据, 直接修改成退完款的状态.如果后面退款失败了.直接回滚了
|
|
// 3.修改数据, 直接修改成退完款的状态.如果后面退款失败了.直接回滚了
|
|
update.status = '-1';
|
|
update.status = '-1';
|
|
update.end_time = moment().format('YYYY-MM-DD HH:mm:ss');
|
|
update.end_time = moment().format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
+ // 4.修改订单状态
|
|
await this.refundOrder(entity, this.tran);
|
|
await this.refundOrder(entity, this.tran);
|
|
} else if (type === '2') {
|
|
} else if (type === '2') {
|
|
// 退货(退库存),退款,退优惠券
|
|
// 退货(退库存),退款,退优惠券
|
|
@@ -139,7 +140,7 @@ class AfterSaleService extends CrudService {
|
|
await this.tran.run();
|
|
await this.tran.run();
|
|
// 退钱
|
|
// 退钱
|
|
if (!refundInfo) return;
|
|
if (!refundInfo) return;
|
|
- console.log(refundInfo);
|
|
|
|
|
|
+ // console.log(refundInfo);
|
|
const res = await this.ctx.service.trade.pay.refund(refundInfo);
|
|
const res = await this.ctx.service.trade.pay.refund(refundInfo);
|
|
if (res.errcode && res.errcode !== 0) throw new BusinessError(ErrorCode.SERVICE_FAULT, res.errmsg);
|
|
if (res.errcode && res.errcode !== 0) throw new BusinessError(ErrorCode.SERVICE_FAULT, res.errmsg);
|
|
} catch (error) {
|
|
} catch (error) {
|