|
@@ -112,7 +112,7 @@ class PayOrderService extends CrudService {
|
|
|
const { from_id: _id, status: is_pay, money, _id: pay_id, config } = data;
|
|
|
if (pay_for === 'lessonStudent') {
|
|
|
// 因为上课产生的支付,去找lessonStudent,修改指定学生的支付状态
|
|
|
- await this.lessonStudentModel.updateOne({ _id }, { is_pay });
|
|
|
+ await this.lessonStudentModel.updateOne({ _id }, { is_pay, pay_id });
|
|
|
// 检查下各种记录
|
|
|
await this.makeRecord(data);
|
|
|
} else if (pay_for === 'tempLessonApply') {
|
|
@@ -148,19 +148,13 @@ class PayOrderService extends CrudService {
|
|
|
let wxBill;
|
|
|
// 检查是否有本次微信支付部分的账单
|
|
|
wxBill = await this.billModel.findOne({ pay_id });
|
|
|
- console.log('data');
|
|
|
- console.log(data);
|
|
|
- console.log('wxBill');
|
|
|
- console.log(wxBill);
|
|
|
if (!wxBill) {
|
|
|
- console.log('line 154 in function: create wxBill');
|
|
|
// 没有微信支付账单,需要创建
|
|
|
const obj = _.pick(data, [ 'school_id', 'payer_id', 'payer_role', 'pay_for', 'from_id', 'time', 'money' ]);
|
|
|
obj.type = '-1';
|
|
|
obj.pay_id = data._id;
|
|
|
obj.is_pay = is_pay;
|
|
|
wxBill = await this.billModel.create(obj);
|
|
|
- console.log(wxBill);
|
|
|
}
|
|
|
|
|
|
|