lrf 2 سال پیش
والد
کامیت
215327d417
1فایلهای تغییر یافته به همراه1 افزوده شده و 4 حذف شده
  1. 1 4
      app/service/user/point.js

+ 1 - 4
app/service/user/point.js

@@ -22,13 +22,11 @@ class PointService extends CrudService {
    */
    */
   async afterPayOrder({ order_id, openid }, tran) {
   async afterPayOrder({ order_id, openid }, tran) {
     if (!tran) throw new BusinessError(ErrorCode.DATA_INVALID, '支付成功添加积分:缺少事务参数');
     if (!tran) throw new BusinessError(ErrorCode.DATA_INVALID, '支付成功添加积分:缺少事务参数');
-    console.log('line 25 in function:');
     const orderData = await this.orderModel.findById(order_id);
     const orderData = await this.orderModel.findById(order_id);
     if (!orderData) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '支付成功添加积分:未找到支付订单信息');
     if (!orderData) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '支付成功添加积分:未找到支付订单信息');
-    console.log('line 28 in function:');
     // 10块钱给1积分,不到10块不给
     // 10块钱给1积分,不到10块不给
     const pay_money = _.get(orderData, 'pay.pay_money');
     const pay_money = _.get(orderData, 'pay.pay_money');
-    // if (!_.isNumber(pay_money) || pay_money < 10) return;
+    if (!_.isNumber(pay_money) || pay_money < 10) return;
     const point = _.floor(pay_money / 10);
     const point = _.floor(pay_money / 10);
     // 添加积分
     // 添加积分
     const user = await this.userModel.findOne({ openid });
     const user = await this.userModel.findOne({ openid });
@@ -43,7 +41,6 @@ class PointService extends CrudService {
       time: moment().format('YYYY-MM-DD HH:mm:ss'),
       time: moment().format('YYYY-MM-DD HH:mm:ss'),
       source: '0',
       source: '0',
     };
     };
-    console.log(pointData);
     tran.insert('Point', pointData);
     tran.insert('Point', pointData);
   }
   }
 }
 }