正在修正im 新增患者问诊限制

This commit is contained in:
2023-04-03 17:27:32 +08:00
parent 7a1d7b2632
commit 0b09004a2c
5 changed files with 44 additions and 14 deletions
+33 -11
View File
@@ -3,6 +3,7 @@
namespace App\Services;
use App\Constants\DoctorTitleCode;
use App\Constants\HttpEnumCode;
use App\Exception\BusinessException;
use App\Model\Hospital;
use App\Model\User;
@@ -215,17 +216,6 @@ class ImService extends BaseService
$redis->hSet($redis_key,$hash_key,json_encode($content,JSON_UNESCAPED_UNICODE));
}
/**
* 发送文本消息
* @param string $from_user_id 发送者id
* @param string $to_user_id 接受者id
* @param string $content 内容
* @param string $order_inquiry_id 订单id
* @param int $inquiry_type
* @return void
* @throws GuzzleException
*/
/**
* 发送消息
* @param string $from_user_id 发送者id
@@ -278,4 +268,36 @@ class ImService extends BaseService
throw new BusinessException($e->getMessage());
}
}
// 问诊已结束
public function sendInquiryEnd(array $order_inquiry,string $from_user_id){
try {
} catch (\Exception $e) {
throw new BusinessException($e->getMessage());
}
// 发送消息
$cloud_custom_data = array();
$cloud_custom_data['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];
$cloud_custom_data['is_system'] = 1;
$cloud_custom_data['inquiry_type'] = $order_inquiry['inquiry_type'];
$cloud_custom_data['message_rounds'] = 0;
$cloud_custom_data['patient_family_data']['patient_name'] = $order_inquiry['patient_name'];
$cloud_custom_data['patient_family_data']['patient_sex'] = $order_inquiry['patient_sex'];
$cloud_custom_data['patient_family_data']['patient_age'] = $order_inquiry['patient_age'];
// 消息内容
$message_content_data = array();
$message_content_data['message_type'] = 1;
$message_content_data['title'] = "问诊已结束";
$message_content_data['desc'] = "线上咨询不能代替问诊,医生的回复仅为建议。";
$message_content = [
'Data' => json_encode($message_content_data,JSON_UNESCAPED_UNICODE),
];
$this->sendMessage($from_user_id, $order_inquiry['user_id'], $message_content, "TIMCustomElem", $cloud_custom_data);
}
}