diff --git a/admin/controllers/base/FinanceController.php b/admin/controllers/base/FinanceController.php index 6a558b0..b58dfb0 100644 --- a/admin/controllers/base/FinanceController.php +++ b/admin/controllers/base/FinanceController.php @@ -177,6 +177,18 @@ class FinanceController extends BaseAdminController $ProductOrder = ProductOrder::find()->where(['id' => $ProductOrderRefund->order_id])->one(); if (!$ProductOrder) throw new Exception('产品订单不存在'); + if ($ProductOrder->order_type === 5) { + $client = new \GuzzleHttp\Client(); + $response = $client->post( 'https://api.xiaokang88.com/open-api/client-confirm', [ + 'json' => [ + 'order_id' => $this->orderId, + ] + ]); + $body = json_decode($response->getBody()->getContents(), true); + if ($body['code'] != 0) { + exit($body['message']); + } + } // 更新订单的退款状态为“已退款” $ProductOrder->refund_status = 3; $ProductOrder->saveOrFail();