修改问诊订单结束推送问题
This commit is contained in:
parent
2030ea8f46
commit
4f90976923
@ -898,8 +898,10 @@ class InquiryService extends BaseService
|
||||
$MessagePush->finishInquiryToDoctor();
|
||||
|
||||
// 患者-发送通知消息-患者的问诊服务结束
|
||||
dump(11111111);
|
||||
$MessagePush = new MessagePush($order_inquiry['user_id'],$order_inquiry['order_inquiry_id']);
|
||||
$MessagePush->patientInquiryFinish();
|
||||
dump(222222222);
|
||||
}catch(\Exception $e){
|
||||
return success([],HttpEnumCode::HTTP_SUCCESS,"消息发送失败");
|
||||
}
|
||||
|
||||
@ -311,59 +311,57 @@ class MessagePush extends BaseService
|
||||
throw new BusinessException("加入推送队列失败:医生数据为空");
|
||||
}
|
||||
|
||||
if ($this->push_type == 1) {
|
||||
// 站内
|
||||
// 服务消息
|
||||
$inquiry_type_string = inquiryTypeToString($this->order_inquiry['inquiry_type']);
|
||||
// 站内
|
||||
// 服务消息
|
||||
$inquiry_type_string = inquiryTypeToString($this->order_inquiry['inquiry_type']);
|
||||
|
||||
$data = array();
|
||||
$data['user_id'] = $this->user['user_id'];
|
||||
$data['notice_type'] = 3;
|
||||
$data['notice_system_type'] = 1;
|
||||
$data['from_name'] = "肝胆小秘书";
|
||||
$data['notice_brief_title'] = "您咨询的【{$inquiry_type_string}】服务已结束,点击查看详情。";
|
||||
$data['notice_title'] = "您咨询的【{$inquiry_type_string}】服务已结束,点击查看详情。";
|
||||
$data['notice_content'] = "您咨询{$user_doctor['user_name']}医生的服务已结束,请对本次问诊服务做出评价。您的评价对医生和其他患者也有很重要的参考价值。您也可以点击医生头像,进入医生主页关注医生。";
|
||||
$data['link_type'] = 10;// 聊天详情页
|
||||
$data = array();
|
||||
$data['user_id'] = $this->user['user_id'];
|
||||
$data['notice_type'] = 3;
|
||||
$data['notice_system_type'] = 1;
|
||||
$data['from_name'] = "肝胆小秘书";
|
||||
$data['notice_brief_title'] = "您咨询的【{$inquiry_type_string}】服务已结束,点击查看详情。";
|
||||
$data['notice_title'] = "您咨询的【{$inquiry_type_string}】服务已结束,点击查看详情。";
|
||||
$data['notice_content'] = "您咨询{$user_doctor['user_name']}医生的服务已结束,请对本次问诊服务做出评价。您的评价对医生和其他患者也有很重要的参考价值。您也可以点击医生头像,进入医生主页关注医生。";
|
||||
$data['link_type'] = 10;// 聊天详情页
|
||||
|
||||
$link_params = array();
|
||||
$link_params['order_inquiry_id'] = $this->order_inquiry['order_inquiry_id'];
|
||||
$link_params['inquiry_type'] = $this->order_inquiry['inquiry_type'];
|
||||
$link_params['doctor_user_id'] = $user_doctor['user_id'];
|
||||
$link_params['patient_user_id'] = $this->order_inquiry['user_id'];
|
||||
$data['link_params'] = json_encode($link_params,JSON_UNESCAPED_UNICODE);// 跳转参数
|
||||
$link_params = array();
|
||||
$link_params['order_inquiry_id'] = $this->order_inquiry['order_inquiry_id'];
|
||||
$link_params['inquiry_type'] = $this->order_inquiry['inquiry_type'];
|
||||
$link_params['doctor_user_id'] = $user_doctor['user_id'];
|
||||
$link_params['patient_user_id'] = $this->order_inquiry['user_id'];
|
||||
$data['link_params'] = json_encode($link_params,JSON_UNESCAPED_UNICODE);// 跳转参数
|
||||
|
||||
$data['button_type'] = 4; // 订单详情
|
||||
$data['button_type'] = 4; // 订单详情
|
||||
|
||||
$message = new SendStationMessageProducer($data);
|
||||
$producer = ApplicationContext::getContainer()->get(Producer::class);
|
||||
$result = $producer->produce($message);
|
||||
if (!$result) {
|
||||
throw new BusinessException("加入推送队列失败" . json_encode($data,JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
} elseif ($this->push_type == 2) {
|
||||
// 订阅
|
||||
$sub_data = array();
|
||||
$sub_data['push_user_id'] = $this->user['user_id'];
|
||||
$sub_data['wx_template_id'] = "9v6dZhjg09CttLd3W9nEUV_-eshNc4BYYNy59jglvZE"; // 问诊提醒
|
||||
$sub_data['params']['page'] = "pages/orderDetail/orderDetail?order_inquiry_id={$this->order_inquiry['order_inquiry_id']}";
|
||||
$sub_data['params']['data'] = [
|
||||
"thing1" => "问诊内容",// 问诊内容
|
||||
"thing2" => "提醒内容",// 提醒内容
|
||||
"name3" => (string)$user_doctor['user_name'],// 问诊医生
|
||||
"thing4" => "提示说明",// 提示说明
|
||||
];
|
||||
$message = new SendStationMessageProducer($data);
|
||||
$producer = ApplicationContext::getContainer()->get(Producer::class);
|
||||
$result = $producer->produce($message);
|
||||
if (!$result) {
|
||||
throw new BusinessException("加入推送队列失败" . json_encode($data,JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data['sub_data'] = $sub_data;
|
||||
$data['sms_data'] = array();
|
||||
// 订阅
|
||||
$sub_data = array();
|
||||
$sub_data['push_user_id'] = $this->user['user_id'];
|
||||
$sub_data['wx_template_id'] = "9v6dZhjg09CttLd3W9nEUV_-eshNc4BYYNy59jglvZE"; // 问诊提醒
|
||||
$sub_data['params']['page'] = "pages/orderDetail/orderDetail?order_inquiry_id={$this->order_inquiry['order_inquiry_id']}";
|
||||
$sub_data['params']['data'] = [
|
||||
"thing1" => "问诊内容",// 问诊内容
|
||||
"thing2" => "提醒内容",// 提醒内容
|
||||
"name3" => (string)$user_doctor['user_name'],// 问诊医生
|
||||
"thing4" => "提示说明",// 提示说明
|
||||
];
|
||||
|
||||
$message = new SendSubMessageProducer($data);
|
||||
$producer = ApplicationContext::getContainer()->get(Producer::class);
|
||||
$result = $producer->produce($message);
|
||||
if (!$result) {
|
||||
throw new BusinessException("加入推送队列失败" . json_encode($data,JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
$data = array();
|
||||
$data['sub_data'] = $sub_data;
|
||||
$data['sms_data'] = array();
|
||||
|
||||
$message = new SendSubMessageProducer($data);
|
||||
$producer = ApplicationContext::getContainer()->get(Producer::class);
|
||||
$result = $producer->produce($message);
|
||||
if (!$result) {
|
||||
throw new BusinessException("加入推送队列失败" . json_encode($data,JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw new BusinessException("加入推送队列失败" . $e->getMessage());
|
||||
@ -493,13 +491,14 @@ class MessagePush extends BaseService
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠劵发放
|
||||
* 患者-优惠劵发放
|
||||
* 站内
|
||||
* @param string $coupon_name
|
||||
* @return bool
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function patientDistributeCoupon(): bool
|
||||
public function patientDistributeCoupon(string $coupon_name): bool
|
||||
{
|
||||
try {
|
||||
$data = array();
|
||||
@ -508,7 +507,7 @@ class MessagePush extends BaseService
|
||||
$data['notice_system_type'] = 2; // 系统消息类型(患者端系统消息存在 1:服务消息 2:福利消息 3:退款消息 4:物流消息)
|
||||
$data['from_name'] = "肝胆小秘书";
|
||||
$data['notice_brief_title'] = "有新的优惠券已下发至您的账户,点击查看详情。";
|
||||
$data['notice_title'] = "【优惠劵名称】已到账";
|
||||
$data['notice_title'] = "【{$coupon_name}】已到账";
|
||||
$data['notice_content'] = "有新的优惠劵已下发至您的账户中,点击查看详情!";
|
||||
$data['link_type'] = 7;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user