lrf 2 vuotta sitten
vanhempi
commit
5c9001e571
1 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 4 4
      app/service/business/payOrder.js

+ 4 - 4
app/service/business/payOrder.js

@@ -125,11 +125,11 @@ class PayOrderService extends CrudService {
       await this.makeRecord(data);
     } else if (pay_for === 'Bill' && is_pay !== '0') {
       // 充值记录,找到充值记录,没有就生成
-      const data = await this.billModel.findOne({ pay_id });
-      if (data) {
+      const billData = await this.billModel.findOne({ pay_id });
+      if (billData) {
         // 有就修改
-        data.is_pay = is_pay;
-        await data.save();
+        billData.is_pay = is_pay;
+        await billData.save();
       } else {
         const obj = _.pick(data, [ 'school_id', 'payer_id', 'payer_role' ]);
         console.log({ ...obj, pay_for: 'Bill', pay_id, is_pay, time: moment().format('YYYY-MM-DD HH:mm:ss'), type: '1' });