|
@@ -22,11 +22,13 @@ class PointService extends CrudService {
|
|
|
*/
|
|
|
async afterPayOrder({ order_id, openid }, tran) {
|
|
|
if (!tran) throw new BusinessError(ErrorCode.DATA_INVALID, '支付成功添加积分:缺少事务参数');
|
|
|
+ console.log('line 25 in function:');
|
|
|
const orderData = await this.orderModel.findById(order_id);
|
|
|
if (!orderData) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '支付成功添加积分:未找到支付订单信息');
|
|
|
+ console.log('line 28 in function:');
|
|
|
// 10块钱给1积分,不到10块不给
|
|
|
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 user = await this.userModel.findOne({ openid });
|