修改消息推送
This commit is contained in:
parent
9daa5124fb
commit
429520d967
@ -310,20 +310,18 @@ class CallBackController extends AbstractController
|
||||
$MessagePush = new MessagePush($order_inquiry['user_id'], $order_inquiry['order_inquiry_id']);
|
||||
|
||||
// 取消订单原因(1:医生未接诊 2:主动取消 3:无可分配医生 4:客服取消 5:支付超时)
|
||||
if ($order_inquiry['cancel_reason'] == 1) {
|
||||
$MessagePush->refundInquirySuccess(1);
|
||||
|
||||
} elseif ($order_inquiry['cancel_reason'] == 2) {
|
||||
$MessagePush->refundInquirySuccess(3);
|
||||
|
||||
} elseif ($order_inquiry['cancel_reason'] == 3) {
|
||||
$MessagePush->refundInquirySuccess(2);
|
||||
}
|
||||
$MessagePush->refundInquirySuccess($order_inquiry['cancel_reason']);
|
||||
|
||||
if (!empty($order_inquiry['coupon_amount_total']) && $order_inquiry['coupon_amount_total'] > 0) {
|
||||
// 获取用户优惠卷信息
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];
|
||||
$order_inquiry_coupon = OrderInquiryCoupon::getOne($params);
|
||||
if (!empty($order_inquiry_coupon)){
|
||||
// 发送站内消息-优惠卷退还
|
||||
$MessagePush = new MessagePush($order_inquiry['user_id'], $order_inquiry['order_inquiry_id']);
|
||||
$MessagePush->patientRefundCoupon();
|
||||
$MessagePush->patientRefundCoupon($order_inquiry_coupon['coupon_name']);
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// 验证失败
|
||||
|
||||
@ -10,6 +10,7 @@ use App\Exception\BusinessException;
|
||||
use App\Model\DoctorWithdrawal;
|
||||
use App\Model\OrderInquiry;
|
||||
use App\Model\OrderInquiryCase;
|
||||
use App\Model\OrderInquiryCoupon;
|
||||
use App\Model\OrderPrescription;
|
||||
use App\Model\OrderProduct;
|
||||
use App\Model\OrderProductItem;
|
||||
@ -200,6 +201,25 @@ class MessagePush extends BaseService
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取问诊订单关联病例
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $this->order_inquiry['order_inquiry_id'];
|
||||
$order_inquiry_case = OrderInquiryCase::getOne($params);
|
||||
if (empty($order_inquiry_case)){
|
||||
Log::getInstance("MessagePush")->error("错误:病例数据为空" );
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取系统接诊配置
|
||||
$params = array();
|
||||
$params['inquiry_type'] = $this->order_inquiry['inquiry_type'];
|
||||
$params['inquiry_mode'] = $this->order_inquiry['inquiry_mode'];
|
||||
$system_inquiry_config = SystemInquiryConfig::getOne($params);
|
||||
if (empty($system_inquiry_config)) {
|
||||
Log::getInstance("MessagePush")->error("错误:获取系统接诊配置失败");
|
||||
return;
|
||||
}
|
||||
|
||||
// 站内
|
||||
$data = array();
|
||||
$data['user_id'] = $this->user['user_id'];
|
||||
@ -227,16 +247,25 @@ class MessagePush extends BaseService
|
||||
Log::getInstance("MessagePush")->error("错误:加入推送队列失败" . json_encode($data,JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
|
||||
// 问诊内容-病情主诉
|
||||
$disease_desc = $order_inquiry_case['disease_desc'];
|
||||
if (!empty($disease_desc)){
|
||||
$disease_desc = substr($disease_desc,0,15);
|
||||
if ($disease_desc){
|
||||
$disease_desc = $disease_desc . "...";
|
||||
}
|
||||
}
|
||||
|
||||
// 订阅
|
||||
$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" => "提醒内容",// 提醒内容
|
||||
"thing1" => (string)$disease_desc,// 问诊内容-病情主诉
|
||||
"thing2" => "{$user_doctor['user_name']}医生已接诊,请您尽快和医生沟通交流病情",// 提醒内容
|
||||
"name3" => (string)$user_doctor['user_name'],// 问诊医生
|
||||
"thing4" => "提示说明",// 提示说明
|
||||
"thing4" => "点击查看问诊订单详情",// 提示说明
|
||||
];
|
||||
|
||||
$data = array();
|
||||
@ -251,15 +280,6 @@ class MessagePush extends BaseService
|
||||
}
|
||||
|
||||
// 短信
|
||||
// 获取系统接诊配置
|
||||
$params = array();
|
||||
$params['inquiry_type'] = $this->order_inquiry['inquiry_type'];
|
||||
$params['inquiry_mode'] = $this->order_inquiry['inquiry_mode'];
|
||||
$system_inquiry_config = SystemInquiryConfig::getOne($params);
|
||||
if (empty($system_inquiry_config)) {
|
||||
Log::getInstance("MessagePush")->error("错误:获取系统接诊配置失败");
|
||||
}
|
||||
|
||||
$duration = $system_inquiry_config['duration'];
|
||||
if ($duration <= 0){
|
||||
$duration = "不限制";
|
||||
@ -279,7 +299,6 @@ class MessagePush extends BaseService
|
||||
$template_param['duration'] = $duration; // 服务时长
|
||||
$data['template_param'] = $template_param;
|
||||
|
||||
|
||||
$message = new SendSmsMessageProducer($data);
|
||||
$producer = ApplicationContext::getContainer()->get(Producer::class);
|
||||
$result = $producer->produce($message);
|
||||
@ -310,6 +329,15 @@ class MessagePush extends BaseService
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取问诊订单关联病例
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $this->order_inquiry['order_inquiry_id'];
|
||||
$order_inquiry_case = OrderInquiryCase::getOne($params);
|
||||
if (empty($order_inquiry_case)){
|
||||
Log::getInstance("MessagePush")->error("错误:病例数据为空" );
|
||||
return;
|
||||
}
|
||||
|
||||
// 站内
|
||||
// 服务消息
|
||||
$inquiry_type_string = inquiryTypeToString($this->order_inquiry['inquiry_type']);
|
||||
@ -319,8 +347,8 @@ class MessagePush extends BaseService
|
||||
$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_brief_title'] = "您的【{$inquiry_type_string}】服务已结束,点击查看详情。";
|
||||
$data['notice_title'] = "您的【{$inquiry_type_string}】服务已结束,点击查看详情。";
|
||||
$data['notice_content'] = "您咨询{$user_doctor['user_name']}医生的服务已结束,请对本次问诊服务做出评价。您的评价对医生和其他患者也有很重要的参考价值。您也可以点击医生头像,进入医生主页关注医生。";
|
||||
$data['link_type'] = 10;// 聊天详情页
|
||||
|
||||
@ -340,16 +368,25 @@ class MessagePush extends BaseService
|
||||
Log::getInstance("MessagePush")->error("错误:加入推送队列失败" . json_encode($data,JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
|
||||
// 问诊内容
|
||||
$disease_desc = $order_inquiry_case['disease_desc'];
|
||||
if (!empty($disease_desc)){
|
||||
$disease_desc = substr($disease_desc,0,15);
|
||||
if ($disease_desc){
|
||||
$disease_desc = $disease_desc . "...";
|
||||
}
|
||||
}
|
||||
|
||||
// 订阅
|
||||
$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" => "提醒内容",// 提醒内容
|
||||
"thing1" => (string)$disease_desc,// 问诊内容
|
||||
"thing2" => "您咨询{$user_doctor['user_name']}医生的服务已结束,请对本次问诊服务做出评价",// 提醒内容
|
||||
"name3" => (string)$user_doctor['user_name'],// 问诊医生
|
||||
"thing4" => "提示说明",// 提示说明
|
||||
"thing4" => "点击查看问诊订单详情",// 提示说明
|
||||
];
|
||||
|
||||
$data = array();
|
||||
@ -520,11 +557,12 @@ class MessagePush extends BaseService
|
||||
/**
|
||||
* 优惠劵退还
|
||||
* 站内
|
||||
* @param string $coupon_name
|
||||
* @return void
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function patientRefundCoupon(): void
|
||||
public function patientRefundCoupon(string $coupon_name): void
|
||||
{
|
||||
try {
|
||||
$data = array();
|
||||
@ -532,8 +570,8 @@ class MessagePush extends BaseService
|
||||
$data['notice_type'] = 3;
|
||||
$data['notice_system_type'] = 2; // 系统消息类型(患者端系统消息存在 1:服务消息 2:福利消息 3:退款消息 4:物流消息)
|
||||
$data['from_name'] = "肝胆小秘书";
|
||||
$data['notice_brief_title'] = "您有优惠劵已退还至您的账户,点击查看详情。";
|
||||
$data['notice_title'] = "【优惠劵名称】已退还";
|
||||
$data['notice_brief_title'] = "优惠劵已退还至您的账户,点击查看详情。";
|
||||
$data['notice_title'] = "【{$coupon_name}】已退还";
|
||||
$data['notice_content'] = "您有优惠劵已退还至您的账户,请点击查看详情!";
|
||||
$data['link_type'] = 7;
|
||||
|
||||
@ -582,12 +620,12 @@ class MessagePush extends BaseService
|
||||
/**
|
||||
* 患者-问诊服务退款成功
|
||||
* 站内、订阅、短信
|
||||
* @param int $type 类型 1:已支付未接诊 2:已支付未成功分配医生 3:已支付未接诊患者取消订单
|
||||
* @param int $cancel_reason 取消订单原因(1:医生未接诊 2:主动取消 3:无可分配医生 4:客服取消 5:支付超时)
|
||||
* @return void
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function refundInquirySuccess(int $type): void
|
||||
public function refundInquirySuccess(int $cancel_reason): void
|
||||
{
|
||||
try {
|
||||
if (!empty($this->order_inquiry['doctor_id'])){
|
||||
@ -609,21 +647,26 @@ class MessagePush extends BaseService
|
||||
$data['notice_type'] = 3;
|
||||
$data['notice_system_type'] = 3;
|
||||
$data['from_name'] = "肝胆小秘书";
|
||||
if ($type == 1){
|
||||
if ($cancel_reason == 1){
|
||||
// 已支付未接诊
|
||||
$data['notice_brief_title'] = "您咨询的【{$inquiry_type_string}】服务,平台 已退款成功,点击查看详情。";
|
||||
$data['notice_title'] = "您咨询的【{$inquiry_type_string}】服务,平台 已退款成功";
|
||||
$data['notice_content'] = "因医生繁忙未及时接诊,平台会在24小时内给您退款至原账户中,带来的不便敬请谅解。";
|
||||
}elseif ($type == 2){
|
||||
$data['notice_brief_title'] = "您的【{$inquiry_type_string}】服务,平台已退款成功,点击查看详情";
|
||||
if ($this->order_inquiry['inquiry_type'] == 1 || $this->order_inquiry['inquiry_type'] == 3){
|
||||
$data['notice_title'] = "您的【{$inquiry_type_string}】服务,平台已退款成功";
|
||||
$data['notice_content'] = "因医生繁忙未及时接诊,平台会在24小时内退款至原账户,给您带来的不便敬请谅解。";
|
||||
}else{
|
||||
$data['notice_title'] = "您的【{$inquiry_type_string}】服务,平台已退款成功";
|
||||
$data['notice_content'] = "因当前候诊人较多,您的咨询暂无医生接诊。平台会在24小时内退款至原账户,给您带来的不便敬请谅解。";
|
||||
}
|
||||
}elseif ($cancel_reason == 2){
|
||||
// 已支付未成功分配医生
|
||||
$data['notice_brief_title'] = "您咨询的【{$inquiry_type_string}】服务,平台 已退款成功,点击查看详情。";
|
||||
$data['notice_title'] = "您咨询的【{$inquiry_type_string}】服务,平台 已退款成功";
|
||||
$data['notice_content'] = "当前服务排队人较多,暂无空闲医生为您接诊,平台会在24小时内给您退款至原账户中,带来的不便敬请谅解。";
|
||||
}elseif ($type == 3){
|
||||
$data['notice_brief_title'] = "您的【{$inquiry_type_string}】服务已取消";
|
||||
$data['notice_title'] = "您的【{$inquiry_type_string}】服务,平台已退款成功";
|
||||
$data['notice_content'] = "因当前候诊人较多,您的咨询暂无医生接诊。平台会在24小时内退款至原账户,给您带来的不便敬请谅解。";
|
||||
}elseif ($cancel_reason == 3){
|
||||
// 已支付未接诊患者取消订单
|
||||
$data['notice_brief_title'] = "您咨询的【{$inquiry_type_string}】服务,平台 已退款成功,点击查看详情。";
|
||||
$data['notice_title'] = "您咨询的【{$inquiry_type_string}】服务,平台 已退款成功";
|
||||
$data['notice_content'] = "您已取消成功当前服务,平台会在24小时内给您退还至原账户中,带来的不便敬请谅解。";
|
||||
$data['notice_brief_title'] = "您的【{$inquiry_type_string}】服务,平台 已退款成功,点击查看详情。";
|
||||
$data['notice_title'] = "您的【{$inquiry_type_string}】服务已取消";
|
||||
$data['notice_content'] = "您已成功取消当前服务,平台会在24小时内退款至原账户,感谢您的支持。";
|
||||
}else{
|
||||
Log::getInstance("MessagePush")->error("错误:类型错误");
|
||||
return ;
|
||||
@ -643,20 +686,6 @@ class MessagePush extends BaseService
|
||||
}
|
||||
|
||||
// 订阅
|
||||
if ($type == 1){
|
||||
// 已支付未接诊
|
||||
$thing4 = "医生未接诊";
|
||||
}elseif ($type == 2){
|
||||
// 已支付未成功分配医生
|
||||
$thing4 = "未分配到合适的医生";
|
||||
}elseif ($type == 3){
|
||||
// 已支付未接诊患者取消订单
|
||||
$thing4 = "用户主动取消";
|
||||
}else{
|
||||
Log::getInstance("MessagePush")->error("错误:类型错误");
|
||||
return ;
|
||||
}
|
||||
|
||||
$sub_data = array();
|
||||
$sub_data['push_user_id'] = $this->user['user_id'];
|
||||
$sub_data['wx_template_id'] = "UOMww1S30Oq7rErJrqO8wN6lNEVKRo2fgcXnb0tBwHI"; //问诊异常通知
|
||||
@ -665,7 +694,7 @@ class MessagePush extends BaseService
|
||||
"character_string1" => $this->order_inquiry['inquiry_no'],// 订单ID
|
||||
"name2" => (string)$user_doctor['user_name'] ?? "无",// 问诊医生
|
||||
"date3" => $this->order_inquiry['created_at'],// 问诊时间
|
||||
"thing4" => $thing4,// 取消原因
|
||||
"thing4" => inquiryCancelReasonToPushString($cancel_reason),// 取消原因
|
||||
"thing5" => "已进行退款处理,请注意查看账户信息。",// 提示说明
|
||||
];
|
||||
|
||||
@ -724,6 +753,8 @@ class MessagePush extends BaseService
|
||||
return ;
|
||||
}
|
||||
|
||||
$order_product = $order_product->toArray();
|
||||
|
||||
// 获取药品订单商品数据
|
||||
$params = array();
|
||||
$params['order_product_id'] = $order_product_id;
|
||||
@ -747,7 +778,14 @@ class MessagePush extends BaseService
|
||||
$product_name_array[] = $product['common_name'];
|
||||
}
|
||||
|
||||
$product_name = "";
|
||||
if (!empty($product_name_array)){
|
||||
if (count($product_name_array) > 1){
|
||||
$product_name = implode('、',$product_name_array);
|
||||
}else{
|
||||
$product_name = $product_name_array[0];
|
||||
}
|
||||
}
|
||||
|
||||
// 站内
|
||||
$data = array();
|
||||
@ -757,7 +795,7 @@ class MessagePush extends BaseService
|
||||
$data['from_name'] = "肝胆小秘书";
|
||||
$data['notice_brief_title'] = "您购买的【{$product_name}】药品,平台已退款成功,点击查看详情";
|
||||
$data['notice_title'] = "您购买的【{$product_name}】药品,平台已退款成功";
|
||||
$data['notice_content'] = "因平台特殊情况发生,导致您的药品无法邮寄。平台已进行退款处理,并退款成功,带来的不便敬请谅解。";
|
||||
$data['notice_content'] = "受特别因素影响,您的药品无法正常配送。平台已退款至原账户,给您带来的不便敬请谅解。";
|
||||
|
||||
$data['link_type'] = 8;// 药品订单详情页
|
||||
|
||||
@ -778,13 +816,13 @@ class MessagePush extends BaseService
|
||||
$sub_data['wx_template_id'] = "gQO5vhPQfdnvXtK0XnGns1XqNhQpOrXTjdl-5HWWMUw";//药品订单取消通知
|
||||
$sub_data['params']['page'] = "pages/medinceOrderDetail/medinceOrderDetail?order_product_id={$order_product_id}";
|
||||
$sub_data['params']['data'] = [
|
||||
"character_string3" => $order_product['order_product_no'],// 订单号
|
||||
"character_string3" => (string)$order_product['order_product_no'],// 订单号
|
||||
|
||||
"time5" => $order_product['cancel_time'],// 取消时间
|
||||
|
||||
"amount4" => $order_product['payment_amount_total'],// 退款金额
|
||||
|
||||
"thing1" => productCancelReasonToString($order_product['cancel_reason']),// 取消原因
|
||||
"thing1" => "受特别因素影响,您的药品无法正常配送",// 取消原因
|
||||
|
||||
"thing6" => "点击详情查看",// 温馨提示
|
||||
|
||||
@ -863,6 +901,8 @@ class MessagePush extends BaseService
|
||||
return ;
|
||||
}
|
||||
|
||||
$order_product = $order_product->toArray();
|
||||
|
||||
// 获取药品订单商品数据
|
||||
$params = array();
|
||||
$params['order_product_id'] = $order_product_id;
|
||||
@ -886,7 +926,14 @@ class MessagePush extends BaseService
|
||||
$product_name_array[] = $product['common_name'];
|
||||
}
|
||||
|
||||
$product_name = "";
|
||||
if (!empty($product_name_array)){
|
||||
if (count($product_name_array) > 1){
|
||||
$product_name = implode('、',$product_name_array);
|
||||
}else{
|
||||
$product_name = $product_name_array[0];
|
||||
}
|
||||
}
|
||||
|
||||
// 订阅
|
||||
$sub_data = array();
|
||||
@ -894,7 +941,7 @@ class MessagePush extends BaseService
|
||||
$sub_data['wx_template_id'] = "YFdVxDclV1ZjhS7E4Cs0zFdshTRizERpwYdZizj_UWo"; // 药品发货通知
|
||||
$sub_data['params']['page'] = "pages/orderDetail/orderDetail?order_inquiry_id={$this->order_inquiry['order_inquiry_id']}";
|
||||
$sub_data['params']['data'] = [
|
||||
"character_string9" => $order_product['order_product_no'],// 快递单号
|
||||
"character_string9" => (string)$order_product['order_product_no'],// 快递单号
|
||||
|
||||
"time7" => $order_product['delivery_time'],// 发货时间
|
||||
|
||||
@ -970,15 +1017,24 @@ class MessagePush extends BaseService
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取问诊订单关联病例
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $this->order_inquiry['order_inquiry_id'];
|
||||
$order_inquiry_case = OrderInquiryCase::getOne($params);
|
||||
if (empty($order_inquiry_case)){
|
||||
Log::getInstance("MessagePush")->error("错误:病例数据为空" );
|
||||
return;
|
||||
}
|
||||
|
||||
// 站内
|
||||
$data = array();
|
||||
$data['user_id'] = $this->user['user_id'];
|
||||
$data['notice_type'] = 1;
|
||||
$data['inquiry_type'] = $this->order_inquiry['inquiry_type']; // 问诊类型(医生端服务通知存在 1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
|
||||
$data['from_name'] = "肝胆小秘书";
|
||||
$data['notice_brief_title'] = "您有新的问诊咨询,请注意查看。";
|
||||
$data['notice_title'] = "您有新的问诊咨询,请注意查看。";
|
||||
$data['notice_content'] = "您有新的问诊咨询,请注意查看。";
|
||||
$data['notice_brief_title'] = "您有新的问诊咨询,请及时处理。";
|
||||
$data['notice_title'] = "您有新的问诊咨询,请及时处理。";
|
||||
$data['notice_content'] = "您有新的问诊咨询,请及时处理。";
|
||||
$data['link_type'] = 1; // 聊天详情页
|
||||
|
||||
$link_params = array();
|
||||
@ -998,22 +1054,32 @@ class MessagePush extends BaseService
|
||||
// 订阅
|
||||
$inquiry_type = inquiryTypeToString($this->order_inquiry['inquiry_type']);
|
||||
|
||||
// 问诊内容-病情主诉
|
||||
$disease_desc = $order_inquiry_case['disease_desc'];
|
||||
if (!empty($disease_desc)){
|
||||
$disease_desc = substr($disease_desc,0,15);
|
||||
if ($disease_desc){
|
||||
$disease_desc = $disease_desc . "...";
|
||||
}
|
||||
}
|
||||
|
||||
$sub_data = array();
|
||||
$sub_data['push_user_id'] = $this->user['user_id'];
|
||||
$sub_data['wx_template_id'] = "G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc";//咨询提醒
|
||||
$sub_data['params']['page'] = "Pages/yishi/wenzhen_v2/wenzhen";
|
||||
$sub_data['params']['data'] = [
|
||||
"thing1" => "您有新的患者向您发起了({$inquiry_type})服务,请您尽快上线接诊;",// 提醒内容
|
||||
"thing1" => "您有一个新的待接诊({$inquiry_type})服务",// 提醒内容
|
||||
|
||||
"name2" => $this->order_inquiry['patient_name'],// 患者姓名
|
||||
"name2" => (string)$this->order_inquiry['patient_name'],// 患者姓名
|
||||
|
||||
"thing4" => (string)$user_doctor['user_name'],// 病情描述
|
||||
"thing4" => (string)$disease_desc,// 病情描述
|
||||
|
||||
"thing6" => "24小时内未接诊,平台将自动取消问诊。",// 提示说明
|
||||
"thing6" => "24小时内未接诊,平台将自动取消问诊",// 提示说明
|
||||
|
||||
"thing5" => "",// 咨询内容
|
||||
|
||||
];
|
||||
|
||||
// 短信
|
||||
$sms_data = array();
|
||||
$sms_data['template_code'] = "SMS_272015117";
|
||||
@ -1239,7 +1305,7 @@ class MessagePush extends BaseService
|
||||
"phrase1" => "药师审方通过",// 审核结果
|
||||
"thing2" => "审核通过",// 原因
|
||||
"date3" => $order_prescription['pharmacist_verify_time'],// 审核时间
|
||||
"thing4" => "提醒患者用药提醒,并结束问诊",// 提示说明
|
||||
"thing4" => "建议您向患者补充说明如何用药",// 提示说明
|
||||
];
|
||||
|
||||
// 短信
|
||||
@ -1295,7 +1361,7 @@ class MessagePush extends BaseService
|
||||
$sub_data['params']['page'] = "Pages/yishi/chufangsetup/index";
|
||||
$sub_data['params']['data'] = [
|
||||
"phrase1" => "药师审方不通过",// 审核结果
|
||||
"thing2" => $order_prescription['pharmacist_fail_reason'],// 原因
|
||||
"thing2" => (string)$order_prescription['pharmacist_fail_reason'],// 原因
|
||||
"date3" => date('Y-m-d',time()),// 审核时间
|
||||
"thing4" => "建议您修改处方并重新为患者开具",// 提示说明
|
||||
];
|
||||
@ -1960,14 +2026,23 @@ class MessagePush extends BaseService
|
||||
Log::getInstance("MessagePush")->error("错误:医生数据为空" );
|
||||
}
|
||||
|
||||
// 获取问诊订单关联病例
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $this->order_inquiry['order_inquiry_id'];
|
||||
$order_inquiry_case = OrderInquiryCase::getOne($params);
|
||||
if (empty($order_inquiry_case)){
|
||||
Log::getInstance("MessagePush")->error("错误:病例数据为空" );
|
||||
return;
|
||||
}
|
||||
|
||||
// 站内
|
||||
$data = array();
|
||||
$data['user_id'] = $this->user['user_id'];
|
||||
$data['notice_type'] = 1;
|
||||
$data['inquiry_type'] = $this->order_inquiry['inquiry_type']; // 问诊类型(医生端服务通知存在 1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
|
||||
$data['from_name'] = "肝胆小秘书";
|
||||
$data['notice_brief_title'] = "患者已取消问诊咨询。";
|
||||
$data['notice_title'] = "患者已取消问诊咨询。";
|
||||
$data['notice_brief_title'] = "患者已取消问诊咨询。。";
|
||||
$data['notice_title'] = inquiryTypeToString($this->order_inquiry['inquiry_type']);
|
||||
$data['notice_content'] = "患者已取消问诊咨询,您可选择其他患者的问诊咨询进行接诊。";
|
||||
$data['link_type'] = 3; // 问诊消息列表页
|
||||
|
||||
@ -1985,6 +2060,15 @@ class MessagePush extends BaseService
|
||||
Log::getInstance("MessagePush")->error("错误:加入推送队列失败" . json_encode($data,JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
|
||||
// 问诊内容-病情主诉
|
||||
$disease_desc = $order_inquiry_case['disease_desc'];
|
||||
if (!empty($disease_desc)){
|
||||
$disease_desc = substr($disease_desc,0,15);
|
||||
if ($disease_desc){
|
||||
$disease_desc = $disease_desc . "...";
|
||||
}
|
||||
}
|
||||
|
||||
$sub_data = array();
|
||||
$sub_data['push_user_id'] = $this->user['user_id'];
|
||||
$sub_data['wx_template_id'] = "G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc";//咨询提醒
|
||||
@ -1992,11 +2076,11 @@ class MessagePush extends BaseService
|
||||
$sub_data['params']['data'] = [
|
||||
"thing1" => "问诊咨询已取消",// 提醒内容
|
||||
|
||||
"name2" => $this->order_inquiry['patient_name'],// 患者姓名
|
||||
"name2" => (string)$this->order_inquiry['patient_name'],// 患者姓名
|
||||
|
||||
"thing4" => (string)$user_doctor['user_name'],// 病情描述
|
||||
"thing4" => (string)$disease_desc,// 病情描述
|
||||
|
||||
"thing6" => "您可以选择其他患者的问诊咨询进行接诊。",// 提示说明
|
||||
"thing6" => "您可以选择其他患者的问诊咨询进行接诊",// 提示说明
|
||||
|
||||
"thing5" => "",// 咨询内容
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user