Browse Source

退款通知

master
weigang 5 years ago
parent
commit
b6c5577af7
  1. 6
      app/JsonRpc/OrdersService.php
  2. 4
      app/Service/v3/Implementations/MiniprogramService.php

6
app/JsonRpc/OrdersService.php

@ -318,15 +318,15 @@ class OrdersService implements OrdersServiceInterface
$refundStoreAmount = bcsub($order->money, $couponMoney, 2); $refundStoreAmount = bcsub($order->money, $couponMoney, 2);
$this->financialRecordService->storeRefundDirect($order->store->user_id, $order->id, $refundStoreAmount); $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') { # 退子订单或者退单品的话,商户只有一个 } elseif ($refundType == 'sub'||$refundType == 'goods') { # 退子订单或者退单品的话,商户只有一个
$orderChildren = Order::query()->with('store:user_id')->where(['id' => $order_child_id])->get(); $orderChildren = Order::query()->with('store:user_id')->where(['id' => $order_child_id])->get();
$this->financialRecordService->storeRefundDirect($orderChild->store->user_id, $orderChild->id, $refundAmount); $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); $this->financialRecordService->userRefundDirect($orderMain->user_id, $orderMain->global_order_id, $refundAmount);

4
app/Service/v3/Implementations/MiniprogramService.php

@ -201,7 +201,7 @@ class MiniprogramService implements MiniprogramServiceInterface
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function subscribeMsgForSingleRefund($orderId, $refundStoreAmount, $orderGoodsId = '')
public function subscribeMsgForSingleRefund($orderId, $refundStoreAmount, $orderGoodsId = '', $note = '')
{ {
$order = Order::query()->where(['id' => $orderId])->first(); $order = Order::query()->where(['id' => $orderId])->first();
@ -227,7 +227,7 @@ class MiniprogramService implements MiniprogramServiceInterface
'thing10' => implode(';', $goodsInfo), 'thing10' => implode(';', $goodsInfo),
'amount3' => $refundStoreAmount, 'amount3' => $refundStoreAmount,
'date4' => $order->updated_at_text ?? '', 'date4' => $order->updated_at_text ?? '',
'thing5' => $order->refund_note ?: '退款',
'thing5' => $note ?: '退款',
], ],
$page $page
); );

Loading…
Cancel
Save