diff --git a/app/JsonRpc/OrdersService.php b/app/JsonRpc/OrdersService.php index a5a0322..0473a12 100644 --- a/app/JsonRpc/OrdersService.php +++ b/app/JsonRpc/OrdersService.php @@ -318,15 +318,15 @@ class OrdersService implements OrdersServiceInterface $refundStoreAmount = bcsub($order->money, $couponMoney, 2); $this->financialRecordService->storeRefundDirect($order->store->user_id, $order->id, $refundStoreAmount); - $this->miniprogramService->subscribeMsgForSingleRefund($order->id, $refundStoreAmount); + $this->miniprogramService->subscribeMsgForSingleRefund($order->id, $refundStoreAmount, '', $note); } } elseif ($refundType == 'sub'||$refundType == 'goods') { # 退子订单或者退单品的话,商户只有一个 $orderChildren = Order::query()->with('store:user_id')->where(['id' => $order_child_id])->get(); $this->financialRecordService->storeRefundDirect($orderChild->store->user_id, $orderChild->id, $refundAmount); - $orderGoodsId = $order_goods_id ?? ''; - $this->miniprogramService->subscribeMsgForSingleRefund($order_child_id, $refundAmount, $orderGoodsId); + $orderGoodsId = $order_goods_id ?: ''; + $this->miniprogramService->subscribeMsgForSingleRefund($order_child_id, $refundAmount, $orderGoodsId, $note); } $this->financialRecordService->userRefundDirect($orderMain->user_id, $orderMain->global_order_id, $refundAmount); diff --git a/app/Service/v3/Implementations/MiniprogramService.php b/app/Service/v3/Implementations/MiniprogramService.php index c6d0771..f3b147d 100644 --- a/app/Service/v3/Implementations/MiniprogramService.php +++ b/app/Service/v3/Implementations/MiniprogramService.php @@ -201,7 +201,7 @@ class MiniprogramService implements MiniprogramServiceInterface /** * @inheritDoc */ - public function subscribeMsgForSingleRefund($orderId, $refundStoreAmount, $orderGoodsId = '') + public function subscribeMsgForSingleRefund($orderId, $refundStoreAmount, $orderGoodsId = '', $note = '') { $order = Order::query()->where(['id' => $orderId])->first(); @@ -227,7 +227,7 @@ class MiniprogramService implements MiniprogramServiceInterface 'thing10' => implode(';', $goodsInfo), 'amount3' => $refundStoreAmount, 'date4' => $order->updated_at_text ?? '', - 'thing5' => $order->refund_note ?: '退款', + 'thing5' => $note ?: '退款', ], $page );