lrf 2 年之前
父节点
当前提交
234bab1c43
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      app/service/trade/order.js

+ 3 - 0
app/service/trade/order.js

@@ -126,6 +126,9 @@ class OrderService extends CrudService {
       assert(order_id, '缺少订单信息');
       const order = await this.model.findById(order_id);
       if (!order) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到订单信息');
+      if (_.get(order, 'pay.result')) {
+        throw new BusinessError(ErrorCode.DATA_INVALID, '该订单已支付完成,无法使用此接口');
+      }
       // 退单分为 2 部分, 涉及价格不需要管.因为这是交钱之前的的操作,不涉及退款
       // 1.货物的库存
       const { goods: shopGoods, total_detail } = order;