|
@@ -122,6 +122,9 @@ class LessonStudentService extends CrudService {
|
|
result.wxSign = wxSign;
|
|
result.wxSign = wxSign;
|
|
}
|
|
}
|
|
await this.tran.run();
|
|
await this.tran.run();
|
|
|
|
+ // 然后将pay_id赋给课程
|
|
|
|
+ this.tran.update('LessonStudent', id, { pay_id });
|
|
|
|
+ await this.tran.run();
|
|
return result;
|
|
return result;
|
|
} catch (error) {
|
|
} catch (error) {
|
|
await this.tran.rollback();
|
|
await this.tran.rollback();
|
|
@@ -192,7 +195,9 @@ class LessonStudentService extends CrudService {
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
// 正常交钱的课,将 pay_id 的status 修改为 -3, 同时触发修改这条数据,但是没有退款;
|
|
// 正常交钱的课,将 pay_id 的status 修改为 -3, 同时触发修改这条数据,但是没有退款;
|
|
|
|
+ console.log(data);
|
|
const payOrder = await this.payOrderModel.findById(data.pay_id);
|
|
const payOrder = await this.payOrderModel.findById(data.pay_id);
|
|
|
|
+ if (!payOrder) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到付款单信息');
|
|
// 再生成账单记录
|
|
// 再生成账单记录
|
|
const obj = _.pick(payOrder, [ 'school_id', 'payer_role', 'payer_id', 'pay_for', 'from_id' ]);
|
|
const obj = _.pick(payOrder, [ 'school_id', 'payer_role', 'payer_id', 'pay_for', 'from_id' ]);
|
|
obj.money = data.money;
|
|
obj.money = data.money;
|
|
@@ -224,7 +229,8 @@ class LessonStudentService extends CrudService {
|
|
return;
|
|
return;
|
|
} catch (error) {
|
|
} catch (error) {
|
|
await this.tran.rollback();
|
|
await this.tran.rollback();
|
|
- throw new Error(error);
|
|
|
|
|
|
+ console.log(error);
|
|
|
|
+ throw Error(error);
|
|
} finally {
|
|
} finally {
|
|
this.tran.clean();
|
|
this.tran.clean();
|
|
}
|
|
}
|