|
@@ -180,7 +180,6 @@ class LessonStudentService extends CrudService {
|
|
async toRefund({ lesson_id, student_id }) {
|
|
async toRefund({ lesson_id, student_id }) {
|
|
const payOrderService = this.ctx.service.business.payOrder;
|
|
const payOrderService = this.ctx.service.business.payOrder;
|
|
const payOrderModel = this.ctx.model.Business.PayOrder;
|
|
const payOrderModel = this.ctx.model.Business.PayOrder;
|
|
- const billModel = this.ctx.model.Business.Bill;
|
|
|
|
const data = await this.model.findOne({ lesson_id, student_id });
|
|
const data = await this.model.findOne({ lesson_id, student_id });
|
|
if (!data) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到数据');
|
|
if (!data) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到数据');
|
|
const lesson = await this.lessonModel.findById(lesson_id);
|
|
const lesson = await this.lessonModel.findById(lesson_id);
|
|
@@ -195,7 +194,7 @@ class LessonStudentService extends CrudService {
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
// 正常交钱的课,将 pay_id 的status 修改为 -3, 同时触发修改这条数据,但是没有退款;
|
|
// 正常交钱的课,将 pay_id 的status 修改为 -3, 同时触发修改这条数据,但是没有退款;
|
|
- await payOrderService.update({ _id: data.pay_id }, { status: '-3' });
|
|
|
|
|
|
+ // await payOrderService.update({ _id: data.pay_id }, { status: '-3' });
|
|
const payOrder = await payOrderModel.findById(data.pay_id);
|
|
const payOrder = await payOrderModel.findById(data.pay_id);
|
|
// 再生成账单记录
|
|
// 再生成账单记录
|
|
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' ]);
|