From 5d30bd25e37868fba8e9723b042eda421826076e Mon Sep 17 00:00:00 2001 From: liqi Date: Sat, 11 Jan 2025 15:06:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81=E8=AE=A2=E5=8D=95=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=94=B6=E8=B4=A7=E8=B0=83=E6=95=B4=EF=BC=8C=E4=BE=9B?= =?UTF-8?q?=E5=BA=94=E5=95=86=E4=BD=99=E9=A2=9D=E7=BB=93=E7=AE=97=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/controllers/base/FinanceController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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();