xieruidong 2 years ago
parent
commit
a26a70ccdb
1 changed files with 3 additions and 0 deletions
  1. 3 0
      application/api/controller/mall/Orders.php

+ 3 - 0
application/api/controller/mall/Orders.php

@@ -280,6 +280,7 @@ class Orders extends Api
                 'amount|金额'=>['require','float','gt:0',"elt:{$orderInfo['amount_pay']}"],
             ]);
         }
+        $fix_order_id=0;
         if($config['req_order']){
             $this->_validate([
                 'fix_order_no|维修订单号'=>['require',],
@@ -299,6 +300,7 @@ class Orders extends Api
             if(!$fixOrder||($goodsBak['goods']['is_fix']??0)!=1){
                 $this->error('请完成维修订单支付');
             }
+            $fix_order_id=$fixOrder['id'];
         }
         if($data['refund_type']==Refund::REFUND_TYPE_ALL){
             $refundCount=$orderInfo->refunds()->where('refund_type',Refund::REFUND_TYPE_ALL)->count();
@@ -318,6 +320,7 @@ class Orders extends Api
             'amount'=>$data['amount'],
             'reason1'=>$data['reason1'],
             'reason2'=>$data['reason2'],
+            'fix_order_id'=>$fix_order_id,
         ]);
         $orderInfo['refund_id']=$newRefund['id'];
         $orderInfo->save();