gorden 2 months ago
parent
commit
39c4886c72
1 changed files with 3 additions and 1 deletions
  1. 3 1
      app/admin/controller/order/RefundController.php

+ 3 - 1
app/admin/controller/order/RefundController.php

@@ -304,9 +304,11 @@ class RefundController extends Curd
             // 主订单,退款作为优惠入库
             $this->updateMainOrderByRefund($order, $amount, $remark);
             // return 表记录
-            if (!OrderReturn::where('join_return_order_id', $orderId)->exists()) {
+            $return = OrderReturn::where('join_return_order_id', $orderId)->first();
+            if (empty($return)) {
                 $returnId = $this->createReturnRecord($order, $amount, $remark);
             } else {
+                $returnId = $return->orders_return_id;
                 //['amount' => $amount, 'user_id' => JwtToken::getCurrentId(), 'datetime' => date('Y-m-d H:i:s'), 'remark' => $remark ?? '']
                 OrderReturn::where('join_return_order_id', $orderId)->update([
                     'order_return_status' => 'DONE',