diff --git a/app/Amqp/Consumer/SendStationMessageConsumer.php b/app/Amqp/Consumer/SendStationMessageConsumer.php index ddb7a31..3fe48ff 100644 --- a/app/Amqp/Consumer/SendStationMessageConsumer.php +++ b/app/Amqp/Consumer/SendStationMessageConsumer.php @@ -138,6 +138,11 @@ class SendStationMessageConsumer extends ConsumerMessage } } + // 消息标题 + if (!isset($push_data['notice_title']) && !isset($push_data['notice_brief_type'])){ + return false; + } + return true; } diff --git a/app/Amqp/Consumer/SendSubMessageConsumer.php b/app/Amqp/Consumer/SendSubMessageConsumer.php index db68900..ce93123 100644 --- a/app/Amqp/Consumer/SendSubMessageConsumer.php +++ b/app/Amqp/Consumer/SendSubMessageConsumer.php @@ -85,6 +85,8 @@ class SendSubMessageConsumer extends ConsumerMessage return Result::DROP; } + Log::getInstance()->info("订阅消息推送数据记录:" . json_encode($send_data,JSON_UNESCAPED_UNICODE)); + // 获取open_id $UserService = new UserService(); $open_id = $UserService->getOpenIdWithUserId($user['user_id'],$user['user_type']); diff --git a/app/Controller/TestController.php b/app/Controller/TestController.php index 56af005..d4ffa59 100644 --- a/app/Controller/TestController.php +++ b/app/Controller/TestController.php @@ -582,9 +582,23 @@ class TestController extends AbstractController } public function test_11(){ - $Prescription = new Prescription(); - $result = $Prescription->getPrescription(); - dump($result); + $data = array(); + $data['sub_data']['params']['data'] = [ + "character_string1"=>"501852690829471745", + "name2"=>"测试药师1", + "date3"=>"2023-04-04 20:23:25", + "thing4"=>"医生未接诊", + "thing5"=>"点击详情更换医生问诊" + ]; + + $send_data = array(); + foreach ($data['sub_data']['params']['data'] as $key => $item){ + $send_data[$key] = [ + "value" => $item + ]; + } + + dump($send_data); die; $order_prescription_id = "501751534291394561"; diff --git a/app/Services/MessagePush.php b/app/Services/MessagePush.php index 30864ca..fb1a734 100644 --- a/app/Services/MessagePush.php +++ b/app/Services/MessagePush.php @@ -83,7 +83,7 @@ class MessagePush extends BaseService $data['notice_title'] = "您咨询的服务暂无医生接诊,点击查看详情。"; $data['notice_content'] = "您咨询的服务当前排队人较多,暂无空闲医生接诊。给您带来不便敬请谅解,平台会在24小时内进行退款,您可以点击订单详情查看退款详情。"; - } elseif ($this->order_inquiry['inquiry_type'] == 1 || $this->order_inquiry['inquiry_type'] == 4) { + } elseif ($this->order_inquiry['inquiry_type'] == 2 || $this->order_inquiry['inquiry_type'] == 4) { // 快速-购药 $data['notice_brief_title'] = "您咨询的医生因工作繁忙没有时间接诊,点击查看详情。"; $data['notice_title'] = "您咨询的医生因工作繁忙没有时间接诊,点击查看详情。";