From d3d5a62fb8e5a098c5d42542589e51a492bbc787 Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Mon, 22 May 2023 09:28:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A8=E9=80=81=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=86=85=E5=AE=B9=EF=BC=8C=E4=BF=AE=E6=94=B9=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E5=A4=84=E6=96=B9=E5=B9=B3=E5=8F=B0=E8=B6=85=E6=97=B6?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Command/getProductCommand.php | 24 +++++++++++------------- app/Services/MessagePush.php | 2 +- extend/Prescription/Prescription.php | 6 +++++- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/app/Command/getProductCommand.php b/app/Command/getProductCommand.php index c9cb8a0..edba3c4 100644 --- a/app/Command/getProductCommand.php +++ b/app/Command/getProductCommand.php @@ -44,29 +44,27 @@ class getProductCommand extends HyperfCommand $page_size = 100; $result = $prescription->getProd(1, 100); if (!empty($result['rows'])){ - $concurrent = new Concurrent(10); - foreach ($result['rows'] as $item) { - $concurrent->create(function () use($item) { - // 执行入库 - $this->handleData($item); - }); + // 执行入库 + $this->handleData($item); } $count = ceil($result['count'] / $page * $page_size); if ($result['count'] > $page * $page_size) { for ($i = 2; $i < $count; $i++) { - $result = $prescription->getProd($i, $page_size); - if (!isset($result['rows'])){ - continue; - } + try { + $result = $prescription->getProd($i, $page_size); + if (!isset($result['rows'])){ + continue; + } - foreach ($result['rows'] as $item) { - $concurrent->create(function () use($item) { + foreach ($result['rows'] as $item) { // 执行入库 $this->handleData($item); - }); + } + }catch (\Exception $e){ + $this->line("部分商品更新失败:" . $e->getMessage()); } } } diff --git a/app/Services/MessagePush.php b/app/Services/MessagePush.php index 3e09e5d..b20b48f 100644 --- a/app/Services/MessagePush.php +++ b/app/Services/MessagePush.php @@ -2089,7 +2089,7 @@ class MessagePush extends BaseService $data['notice_type'] = 1; $data['inquiry_type'] = $this->order_inquiry['inquiry_type']; // 问诊类型(医生端服务通知存在 1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药) $data['from_name'] = "肝胆小秘书"; - $data['notice_brief_title'] = inquiryTypeToString($this->order_inquiry['inquiry_type']); + $data['notice_brief_title'] = "患者已取消问诊咨询,您可选择其他患者的问诊咨询进行接诊。"; $data['notice_title'] = "患者已取消问诊咨询,您可选择其他患者的问诊咨询进行接诊。"; $data['notice_content'] = "患者已取消问诊咨询,您可选择其他患者的问诊咨询进行接诊。"; $data['link_type'] = 3; // 问诊消息列表页 diff --git a/extend/Prescription/Prescription.php b/extend/Prescription/Prescription.php index ed5ed71..ce06eca 100644 --- a/extend/Prescription/Prescription.php +++ b/extend/Prescription/Prescription.php @@ -39,7 +39,11 @@ class Prescription $this->client_secret = config('prescription_platform.client_secret'); $this->pharmacy_code = config('prescription_platform.pharmacy_code'); $this->container = ApplicationContext::getContainer(); - $this->client = $this->container->get(Client::class); + $this->client = make(Client::class, [ + 'config' => [ + 'timeout' => 5, + ], + ]); } /**