|
@@ -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',
|