From 12a4846d0ef6bbacedce6465228475a05492d38f Mon Sep 17 00:00:00 2001 From: haomingming Date: Mon, 1 Dec 2025 11:03:20 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/Prescription/Prescription.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/extend/Prescription/Prescription.php b/extend/Prescription/Prescription.php index 7c40750..88d6911 100644 --- a/extend/Prescription/Prescription.php +++ b/extend/Prescription/Prescription.php @@ -106,23 +106,29 @@ class Prescription ), ]; + Log::getInstance()->info("处方平台获取药品请求数据:" . json_encode($option,JSON_UNESCAPED_UNICODE)); try { $response = $this->httpRequest($this->api_url . $this->version . '/drug/syncDrugCatalogue', $option); if (empty($response['data'])){ // 返回值为空 if (!empty($response['message'])){ + Log::getInstance()->error("处方平台获取药品返回数据为空:" . json_encode($response,JSON_UNESCAPED_UNICODE)); throw new BusinessException($response['message']); } + Log::getInstance()->error("处方平台获取药品返回数据为空,无错误信息"); throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR)); } if (empty($response['data']['result'])){ // 返回值为空 + Log::getInstance()->error("处方平台获取药品返回result为空:" . json_encode($response,JSON_UNESCAPED_UNICODE)); throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR)); } + Log::getInstance()->info("处方平台获取药品返回数据:" . json_encode($response,JSON_UNESCAPED_UNICODE)); return $response['data']['result']; } catch (GuzzleException $e) { + Log::getInstance()->error("处方平台获取药品请求异常:" . $e->getMessage()); throw new BusinessException($e->getMessage()); } } @@ -283,19 +289,30 @@ class Prescription $arg = array_merge($arg,$option); } + // 记录请求日志(隐藏敏感信息) + $logArg = $arg; + if (isset($logArg['headers']['Authorization'])) { + $logArg['headers']['Authorization'] = 'Bearer ***'; + } + Log::getInstance()->info("处方平台HTTP请求:" . $path . ",请求参数:" . json_encode($logArg,JSON_UNESCAPED_UNICODE)); + $response = $this->client->post($path, $arg); if ($response->getStatusCode() != '200'){ // 请求失败 - throw new BusinessException($response->getBody()->getContents()); + $errorBody = $response->getBody()->getContents(); + Log::getInstance()->error("处方平台HTTP请求失败,状态码:" . $response->getStatusCode() . ",错误信息:" . $errorBody); + throw new BusinessException($errorBody); } $body = json_decode($response->getBody(),true); if (empty($body)){ // 返回值为空 + Log::getInstance()->error("处方平台HTTP请求返回值为空,路径:" . $path); throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR)); } + Log::getInstance()->info("处方平台HTTP请求成功,路径:" . $path . ",返回数据:" . json_encode($body,JSON_UNESCAPED_UNICODE)); return $body; } } \ No newline at end of file From a33fe1033d0867210957adb06f09c4b960149985 Mon Sep 17 00:00:00 2001 From: haomingming Date: Mon, 1 Dec 2025 11:19:17 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/Prescription/Prescription.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/extend/Prescription/Prescription.php b/extend/Prescription/Prescription.php index 88d6911..7f0f493 100644 --- a/extend/Prescription/Prescription.php +++ b/extend/Prescription/Prescription.php @@ -291,9 +291,7 @@ class Prescription // 记录请求日志(隐藏敏感信息) $logArg = $arg; - if (isset($logArg['headers']['Authorization'])) { - $logArg['headers']['Authorization'] = 'Bearer ***'; - } + Log::getInstance()->info("处方平台HTTP请求:" . $path . ",请求参数:" . json_encode($logArg,JSON_UNESCAPED_UNICODE)); $response = $this->client->post($path, $arg); From 206a765044ee535fe7ffde7df2ec79213e7be327 Mon Sep 17 00:00:00 2001 From: haomingming Date: Mon, 1 Dec 2025 16:20:07 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/Ca/Ca.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/extend/Ca/Ca.php b/extend/Ca/Ca.php index 851ebc9..5981289 100644 --- a/extend/Ca/Ca.php +++ b/extend/Ca/Ca.php @@ -350,6 +350,12 @@ abstract class Ca */ public function httpRequest(string $path, array $arg = []): mixed { + // 请求前日志 + Log::getInstance()->info('CA-HTTP-REQUEST-START', [ + 'url' => $path, + 'params' => $arg, + ]); + $option = [ "headers" => [ "app_id" => $this->app_id, @@ -359,10 +365,21 @@ abstract class Ca $arg = array_merge($arg, $option); + // 合并 header 后的最终请求参数日志 + Log::getInstance()->info('CA-HTTP-REQUEST-PARAMS', [ + 'url' => $path, + 'final_params' => $arg, + ]); + $response = $this->client->post($path, $arg); if ($response->getStatusCode() != '200') { // 请求失败 + Log::getInstance()->error('CA-HTTP-REQUEST-ERROR', [ + 'url' => $path, + 'status_code' => $response->getStatusCode(), + 'response' => $response->getBody()->getContents(), + ]); throw new BusinessException($response->getBody()->getContents()); } $body = json_decode($response->getBody(), true); @@ -379,6 +396,12 @@ abstract class Ca throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR)); } + // 请求成功日志 + Log::getInstance()->info('CA-HTTP-REQUEST-SUCCESS', [ + 'url' => $path, + 'response' => $body, + ]); + return $body['body']; } From bd0a3512bc862f028722851acaf00db0cc102ff0 Mon Sep 17 00:00:00 2001 From: haomingming Date: Mon, 1 Dec 2025 16:26:26 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/Ca/Ca.php | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/extend/Ca/Ca.php b/extend/Ca/Ca.php index 5981289..d7dc351 100644 --- a/extend/Ca/Ca.php +++ b/extend/Ca/Ca.php @@ -351,9 +351,9 @@ abstract class Ca public function httpRequest(string $path, array $arg = []): mixed { // 请求前日志 - Log::getInstance()->info('CA-HTTP-REQUEST-START', [ - 'url' => $path, - 'params' => $arg, + Log::getInstance()->info('CA接口请求开始', [ + '请求地址' => $path, + '原始参数' => $arg, ]); $option = [ @@ -366,30 +366,48 @@ abstract class Ca $arg = array_merge($arg, $option); // 合并 header 后的最终请求参数日志 - Log::getInstance()->info('CA-HTTP-REQUEST-PARAMS', [ - 'url' => $path, - 'final_params' => $arg, + Log::getInstance()->info('CA接口最终请求参数', [ + '请求地址' => $path, + '最终参数' => $arg, ]); $response = $this->client->post($path, $arg); + // 记录原始响应(未解析) + Log::getInstance()->info('CA接口原始响应', [ + '请求地址' => $path, + 'HTTP状态码' => $response->getStatusCode(), + '原始响应内容' => (string)$response->getBody(), + ]); + if ($response->getStatusCode() != '200') { // 请求失败 - Log::getInstance()->error('CA-HTTP-REQUEST-ERROR', [ - 'url' => $path, - 'status_code' => $response->getStatusCode(), - 'response' => $response->getBody()->getContents(), + Log::getInstance()->error('CA接口请求失败', [ + '请求地址' => $path, + 'HTTP状态码' => $response->getStatusCode(), + '响应内容' => $response->getBody()->getContents(), ]); throw new BusinessException($response->getBody()->getContents()); } $body = json_decode($response->getBody(), true); + + // 记录接口返回的完整 body + Log::getInstance()->info('CA接口返回BODY', [ + '请求地址' => $path, + '返回数据' => $body, + ]); + if (empty($body)) { // 返回值为空 throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR)); } if ($body['result_code'] != 0) { - // 请求失败 + // 业务失败 + Log::getInstance()->error('CA业务处理失败', [ + '请求地址' => $path, + '返回数据' => $body, + ]); if (!empty($body['result_msg'])) { throw new BusinessException($body['result_msg']); } @@ -397,9 +415,9 @@ abstract class Ca } // 请求成功日志 - Log::getInstance()->info('CA-HTTP-REQUEST-SUCCESS', [ - 'url' => $path, - 'response' => $body, + Log::getInstance()->info('CA接口请求成功', [ + '请求地址' => $path, + '返回数据' => $body, ]); return $body['body']; From 31c034eee172ba20e2ab72070ca8151fdf7db649 Mon Sep 17 00:00:00 2001 From: haomingming Date: Mon, 1 Dec 2025 16:45:33 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=BB=98=E8=AE=A4ca=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/CaService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/CaService.php b/app/Services/CaService.php index 03b2adf..6e821ba 100644 --- a/app/Services/CaService.php +++ b/app/Services/CaService.php @@ -84,7 +84,7 @@ class CaService extends BaseService if ($app_env == 'prod'){ $this->entity_id = $user_doctor_info['user_id']; }else{ - $this->entity_id = "491925054435950592"; + $this->entity_id = "516904855112556544"; } $this->card_num = $user_doctor_info['card_num']; From e22d2380a4921b36ce714d2dd958b88f73db3413 Mon Sep 17 00:00:00 2001 From: haomingming Date: Mon, 1 Dec 2025 17:40:57 +0800 Subject: [PATCH 06/11] =?UTF-8?q?5345345461=20=E6=94=B9=E4=B8=BA=205345345?= =?UTF-8?q?46?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/CaService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/CaService.php b/app/Services/CaService.php index 6e821ba..14f5149 100644 --- a/app/Services/CaService.php +++ b/app/Services/CaService.php @@ -67,7 +67,7 @@ class CaService extends BaseService if ($type == 1){ // 医院 $this->sign_image_path = "basic/file/hospital_signature.png"; - $this->entity_id = "5345345461"; + $this->entity_id = "534534546"; $this->card_num = "91510106MABTJY4K9R"; }elseif($type == 2){ // 用户 From 270db5c04037f1d742730636624bbef9986e3203 Mon Sep 17 00:00:00 2001 From: haomingming Date: Tue, 2 Dec 2025 15:02:01 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E8=8D=AF=E5=BA=97?= =?UTF-8?q?=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/OrderPrescriptionService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Services/OrderPrescriptionService.php b/app/Services/OrderPrescriptionService.php index e34a073..7b325cf 100644 --- a/app/Services/OrderPrescriptionService.php +++ b/app/Services/OrderPrescriptionService.php @@ -393,7 +393,8 @@ class OrderPrescriptionService extends BaseService $prescription_pdf_oss_path = "/applet/prescription/" . $order_prescription["order_prescription_id"] . ".pdf"; $arg = array(); - $arg['terminalCode'] = "ZD-10003"; + // $arg['terminalCode'] = "ZD-10003"; + $arg['terminalCode'] = "ZD-10199"; $arg['orderNo'] = $order_product['order_product_no']; // 订单编号 $arg['transactNo'] = $order_product['escrow_trade_no']; // 流水单号 $arg['payDate'] = $order_product['pay_time']; // 支付时间 From 6e90c52cb87df6023fec146b2c35a3bc0f6ce7f7 Mon Sep 17 00:00:00 2001 From: haomingming Date: Tue, 2 Dec 2025 16:25:18 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E5=A4=84=E6=96=B9?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/OrderPrescriptionService.php | 2 +- config/config.php | 4 +++- extend/Prescription/Prescription.php | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Services/OrderPrescriptionService.php b/app/Services/OrderPrescriptionService.php index 7b325cf..c9ca983 100644 --- a/app/Services/OrderPrescriptionService.php +++ b/app/Services/OrderPrescriptionService.php @@ -394,7 +394,7 @@ class OrderPrescriptionService extends BaseService $arg = array(); // $arg['terminalCode'] = "ZD-10003"; - $arg['terminalCode'] = "ZD-10199"; + $arg['terminalCode'] = config('prescription_platform.terminal_code'); $arg['orderNo'] = $order_product['order_product_no']; // 订单编号 $arg['transactNo'] = $order_product['escrow_trade_no']; // 流水单号 $arg['payDate'] = $order_product['pay_time']; // 支付时间 diff --git a/config/config.php b/config/config.php index 9fb07ba..6497f4a 100644 --- a/config/config.php +++ b/config/config.php @@ -113,7 +113,9 @@ return [ "client_id" => env('PRE_PLAT_CLIENT_ID', 'ZD-004'), "client_secret" => env('PRE_PLAT_CLIENT_SECRET', '0baa5927164710b9f800bf33546b6da3'), "api_url" => env('PRE_PLAT_APP_URL', 'http://49.233.3.200:6304/api/thridapi/'), - "pharmacy_code" => env('PRE_PLAT_PHARMACY_CODE', 'ZD-10003'), // 药店编码 + "pharmacy_code" => env('PRE_PLAT_PHARMACY_CODE', 'ZD-10198'), // 药店编码 + "zhongduan_code" => env('PRE_PLAT_ZHONGDUAN_CODE', 'ZD-10199'), // 终端编码 + "terminal_code" => env('PRE_PLAT_TERMINAL_CODE', 'ZD-10199'), // 机构编码 ], 'regulatory_platform' => [ // 四川省互联网医疗服务监管平台 "client_id" => env('REG_PLAT_CLIENT_ID', '09b117f8d1eb4dbfbf565447205ea60f'), diff --git a/extend/Prescription/Prescription.php b/extend/Prescription/Prescription.php index 7f0f493..b041275 100644 --- a/extend/Prescription/Prescription.php +++ b/extend/Prescription/Prescription.php @@ -226,9 +226,10 @@ class Prescription */ public function getPrescription(string $order_product_no,string $prescription_code): array { + $terminal_code = config('prescription_platform.terminal_code'); $option = [ "json" => [ - "terminalCode" => "ZD-10003", + "terminalCode" => $terminal_code, "orderNo" => $order_product_no, "prescriptionNo" => $prescription_code, ] From 93d5aae5ac8222c4fd4d0627ac6b5e3c9b02d22f Mon Sep 17 00:00:00 2001 From: haomingming Date: Tue, 2 Dec 2025 16:41:30 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E5=8E=BB=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/Ca/Ca.php | 60 ++++++++++++++-------------- extend/Prescription/Prescription.php | 18 ++++----- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/extend/Ca/Ca.php b/extend/Ca/Ca.php index d7dc351..d86e86b 100644 --- a/extend/Ca/Ca.php +++ b/extend/Ca/Ca.php @@ -351,10 +351,10 @@ abstract class Ca public function httpRequest(string $path, array $arg = []): mixed { // 请求前日志 - Log::getInstance()->info('CA接口请求开始', [ - '请求地址' => $path, - '原始参数' => $arg, - ]); + // Log::getInstance()->info('CA接口请求开始', [ + // '请求地址' => $path, + // '原始参数' => $arg, + // ]); $option = [ "headers" => [ @@ -366,36 +366,36 @@ abstract class Ca $arg = array_merge($arg, $option); // 合并 header 后的最终请求参数日志 - Log::getInstance()->info('CA接口最终请求参数', [ - '请求地址' => $path, - '最终参数' => $arg, - ]); + // Log::getInstance()->info('CA接口最终请求参数', [ + // '请求地址' => $path, + // '最终参数' => $arg, + // ]); $response = $this->client->post($path, $arg); // 记录原始响应(未解析) - Log::getInstance()->info('CA接口原始响应', [ - '请求地址' => $path, - 'HTTP状态码' => $response->getStatusCode(), - '原始响应内容' => (string)$response->getBody(), - ]); + // Log::getInstance()->info('CA接口原始响应', [ + // '请求地址' => $path, + // 'HTTP状态码' => $response->getStatusCode(), + // '原始响应内容' => (string)$response->getBody(), + // ]); if ($response->getStatusCode() != '200') { // 请求失败 - Log::getInstance()->error('CA接口请求失败', [ - '请求地址' => $path, - 'HTTP状态码' => $response->getStatusCode(), - '响应内容' => $response->getBody()->getContents(), - ]); + // Log::getInstance()->error('CA接口请求失败', [ + // '请求地址' => $path, + // 'HTTP状态码' => $response->getStatusCode(), + // '响应内容' => $response->getBody()->getContents(), + // ]); throw new BusinessException($response->getBody()->getContents()); } $body = json_decode($response->getBody(), true); // 记录接口返回的完整 body - Log::getInstance()->info('CA接口返回BODY', [ - '请求地址' => $path, - '返回数据' => $body, - ]); + // Log::getInstance()->info('CA接口返回BODY', [ + // '请求地址' => $path, + // '返回数据' => $body, + // ]); if (empty($body)) { // 返回值为空 @@ -404,10 +404,10 @@ abstract class Ca if ($body['result_code'] != 0) { // 业务失败 - Log::getInstance()->error('CA业务处理失败', [ - '请求地址' => $path, - '返回数据' => $body, - ]); + // Log::getInstance()->error('CA业务处理失败', [ + // '请求地址' => $path, + // '返回数据' => $body, + // ]); if (!empty($body['result_msg'])) { throw new BusinessException($body['result_msg']); } @@ -415,10 +415,10 @@ abstract class Ca } // 请求成功日志 - Log::getInstance()->info('CA接口请求成功', [ - '请求地址' => $path, - '返回数据' => $body, - ]); + // Log::getInstance()->info('CA接口请求成功', [ + // '请求地址' => $path, + // '返回数据' => $body, + // ]); return $body['body']; } diff --git a/extend/Prescription/Prescription.php b/extend/Prescription/Prescription.php index b041275..cb1ff4e 100644 --- a/extend/Prescription/Prescription.php +++ b/extend/Prescription/Prescription.php @@ -106,7 +106,7 @@ class Prescription ), ]; - Log::getInstance()->info("处方平台获取药品请求数据:" . json_encode($option,JSON_UNESCAPED_UNICODE)); + // Log::getInstance()->info("处方平台获取药品请求数据:" . json_encode($option,JSON_UNESCAPED_UNICODE)); try { $response = $this->httpRequest($this->api_url . $this->version . '/drug/syncDrugCatalogue', $option); if (empty($response['data'])){ @@ -121,11 +121,11 @@ class Prescription if (empty($response['data']['result'])){ // 返回值为空 - Log::getInstance()->error("处方平台获取药品返回result为空:" . json_encode($response,JSON_UNESCAPED_UNICODE)); + // Log::getInstance()->error("处方平台获取药品返回result为空:" . json_encode($response,JSON_UNESCAPED_UNICODE)); throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR)); } - Log::getInstance()->info("处方平台获取药品返回数据:" . json_encode($response,JSON_UNESCAPED_UNICODE)); + // Log::getInstance()->info("处方平台获取药品返回数据:" . json_encode($response,JSON_UNESCAPED_UNICODE)); return $response['data']['result']; } catch (GuzzleException $e) { Log::getInstance()->error("处方平台获取药品请求异常:" . $e->getMessage()); @@ -204,14 +204,14 @@ class Prescription "json" => $arg ]; - Log::getInstance()->info("处方平台上报数据:" . json_encode($option,JSON_UNESCAPED_UNICODE)); + // Log::getInstance()->info("处方平台上报数据:" . json_encode($option,JSON_UNESCAPED_UNICODE)); try { $response = $this->httpRequest($this->api_url . $this->version . '/preOrder/receivePreOrder', $option); if (empty($response)){ // 返回值错误为空 throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR)); } - Log::getInstance()->info("处方平台返回数据:" . json_encode($response,JSON_UNESCAPED_UNICODE)); + // Log::getInstance()->info("处方平台返回数据:" . json_encode($response,JSON_UNESCAPED_UNICODE)); return $response; } catch (GuzzleException $e) { throw new BusinessException($e->getMessage()); @@ -293,25 +293,25 @@ class Prescription // 记录请求日志(隐藏敏感信息) $logArg = $arg; - Log::getInstance()->info("处方平台HTTP请求:" . $path . ",请求参数:" . json_encode($logArg,JSON_UNESCAPED_UNICODE)); + // Log::getInstance()->info("处方平台HTTP请求:" . $path . ",请求参数:" . json_encode($logArg,JSON_UNESCAPED_UNICODE)); $response = $this->client->post($path, $arg); if ($response->getStatusCode() != '200'){ // 请求失败 $errorBody = $response->getBody()->getContents(); - Log::getInstance()->error("处方平台HTTP请求失败,状态码:" . $response->getStatusCode() . ",错误信息:" . $errorBody); + // Log::getInstance()->error("处方平台HTTP请求失败,状态码:" . $response->getStatusCode() . ",错误信息:" . $errorBody); throw new BusinessException($errorBody); } $body = json_decode($response->getBody(),true); if (empty($body)){ // 返回值为空 - Log::getInstance()->error("处方平台HTTP请求返回值为空,路径:" . $path); + // Log::getInstance()->error("处方平台HTTP请求返回值为空,路径:" . $path); throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR)); } - Log::getInstance()->info("处方平台HTTP请求成功,路径:" . $path . ",返回数据:" . json_encode($body,JSON_UNESCAPED_UNICODE)); + // Log::getInstance()->info("处方平台HTTP请求成功,路径:" . $path . ",返回数据:" . json_encode($body,JSON_UNESCAPED_UNICODE)); return $body; } } \ No newline at end of file From 7c1c63cbbf7d7ca0393cf2b122ec5ba571bb99cd Mon Sep 17 00:00:00 2001 From: haomingming Date: Mon, 22 Dec 2025 10:16:01 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=BF=90=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/PatientOrderService.php | 38 +++++++++++++++------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/app/Services/PatientOrderService.php b/app/Services/PatientOrderService.php index 737696a..e4f03c4 100644 --- a/app/Services/PatientOrderService.php +++ b/app/Services/PatientOrderService.php @@ -1677,18 +1677,17 @@ class PatientOrderService extends BaseService // 处理运费数据 $app_env = config('app_env', 'prod'); - if ($app_env != "dev") { - // 获取运费金额 - $Prescription = new Prescription(); - - $result = $Prescription->getLogisticsFee(); - if ($freight_calculation_amount >= $result['drugCost']) { - $logistics_fee = 0; - } else { - $logistics_fee = $result['freight']; - } - } else { - $logistics_fee = 0; + if (env("APP_ENV") == "prod") { + // $Prescription = new Prescription(); + // $result = $Prescription->getLogisticsFee(); + // if ($freight_calculation_amount < $result['drugCost']) { + // $logistics_fee = $result['freight']; + // } + //测试环境 运费 + $logistics_fee = 6; + }else{ + //测试环境 运费 + $logistics_fee = 1.9; } // 实际支付金额=商品总金额-优惠卷金额+运费金额 @@ -2291,11 +2290,16 @@ class PatientOrderService extends BaseService // 获取运费金额 $logistics_fee = 0; if (env("APP_ENV") == "prod") { - $Prescription = new Prescription(); - $result = $Prescription->getLogisticsFee(); - if ($freight_calculation_amount < $result['drugCost']) { - $logistics_fee = $result['freight']; - } + // $Prescription = new Prescription(); + // $result = $Prescription->getLogisticsFee(); + // if ($freight_calculation_amount < $result['drugCost']) { + // $logistics_fee = $result['freight']; + // } + //测试环境 运费 + $logistics_fee = 6; + }else{ + //测试环境 运费 + $logistics_fee = 1.9; } // 实际支付金额=商品总金额-优惠卷金额+运费金额 From 8da16704e6bc878573b2d05273fd58a314e481e0 Mon Sep 17 00:00:00 2001 From: haomingming Date: Mon, 22 Dec 2025 13:29:12 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E8=BF=90=E8=B4=B9=207?= =?UTF-8?q?=20=E5=85=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/PatientOrderService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/PatientOrderService.php b/app/Services/PatientOrderService.php index e4f03c4..276f602 100644 --- a/app/Services/PatientOrderService.php +++ b/app/Services/PatientOrderService.php @@ -1684,7 +1684,7 @@ class PatientOrderService extends BaseService // $logistics_fee = $result['freight']; // } //测试环境 运费 - $logistics_fee = 6; + $logistics_fee = 7; }else{ //测试环境 运费 $logistics_fee = 1.9; @@ -2296,7 +2296,7 @@ class PatientOrderService extends BaseService // $logistics_fee = $result['freight']; // } //测试环境 运费 - $logistics_fee = 6; + $logistics_fee = 7; }else{ //测试环境 运费 $logistics_fee = 1.9;