lrf 2 年之前
父節點
當前提交
fbbb1bbf02
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      app/service/trade/afterSale.js

+ 2 - 4
app/service/trade/afterSale.js

@@ -99,11 +99,9 @@ class AfterSaleService extends CrudService {
       // 部分退,部分退是不退优惠券的
       refundMoney = needRefund;
     }
-    // 找下当前这个订单有多少次售后记录
-    let num = await this.model.count({ order_detail: data.order_detail });
-    num += 2;
     // 组成退款单号
-    const out_refund_no = `${order_no}-r${num}`;
+    const str = this.ctx.service.util.trade.createNonceStr();
+    const out_refund_no = `${order_no}-r-${str}`;
     const obj = { reason, money: refundMoney, order_no, out_refund_no };
     // 退款请求
     if (refundMoney > 0) {