新增ca认证对接、新增银行卡、身份证验证、修正消息通知
This commit is contained in:
@@ -225,7 +225,60 @@ class ImService extends BaseService
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function sendTextMessage(string $from_user_id,string $to_user_id,string $content,string $order_inquiry_id,int $inquiry_type): void
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
* @param string $from_user_id 发送者id
|
||||
* @param string $to_user_id 接受者id
|
||||
* @param array $message_content 内容 对应 MsgBody.MsgContent
|
||||
* @param string $message_type 消息类型 具体查看(https://cloud.tencent.com/document/product/269/2720)
|
||||
* @param array $cloud_custom_data 自定义字段
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function sendMessage(string $from_user_id, string $to_user_id, array $message_content, string $message_type, array $cloud_custom_data): void
|
||||
{
|
||||
if (!empty($from_user_id)){
|
||||
// 检测并创建发送者资料
|
||||
$this->setUserProfile($from_user_id);
|
||||
}
|
||||
|
||||
// 检测并创建接收者资料
|
||||
$this->setUserProfile($to_user_id);
|
||||
|
||||
$message = new Message();
|
||||
|
||||
$arg = array();
|
||||
if (!empty($from_user_id)){
|
||||
$arg['From_Account'] = $from_user_id; // 发送方user_id 如系统发送,无需填写
|
||||
}
|
||||
$arg['To_Account'] = $to_user_id; // 接收方user_id
|
||||
$arg['ForbidCallbackControl'] = ['ForbidBeforeSendMsgCallback',];
|
||||
$arg['SendMsgControl'] = ['NoUnread'];
|
||||
|
||||
$arg['MsgBody'] = [
|
||||
[
|
||||
"MsgType" => $message_type,
|
||||
"MsgContent" => $message_content,
|
||||
]
|
||||
];
|
||||
|
||||
// 自定义消息
|
||||
// $cloud_custom_data = array();
|
||||
// $cloud_custom_data['order_inquiry_id'] = $order_inquiry_id;
|
||||
// $cloud_custom_data['is_system'] = 1;
|
||||
// $cloud_custom_data['inquiry_type'] = $inquiry_type;
|
||||
|
||||
$arg['CloudCustomData'] = "";
|
||||
if (!empty($cloud_custom_data)){
|
||||
$arg['CloudCustomData'] = json_encode($cloud_custom_data,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
$message->sendMessage($arg);
|
||||
}
|
||||
|
||||
// 发送自定义消息
|
||||
public function sendCustomMessage(string $from_user_id,string $to_user_id,string $content,string $order_inquiry_id,int $inquiry_type): void
|
||||
{
|
||||
if (!empty($from_user_id)){
|
||||
// 检测并创建发送者资料
|
||||
@@ -235,7 +288,6 @@ class ImService extends BaseService
|
||||
// 检测并创建接收者资料
|
||||
$this->setUserProfile($to_user_id);
|
||||
|
||||
// 医生给患者发送消息
|
||||
$message = new Message();
|
||||
|
||||
$arg = array();
|
||||
@@ -248,9 +300,9 @@ class ImService extends BaseService
|
||||
|
||||
$arg['MsgBody'] = [
|
||||
[
|
||||
"MsgType" => "TIMTextElem",
|
||||
"MsgType" => "TIMCustomElem",
|
||||
"MsgContent" => [
|
||||
"Text" => $content,
|
||||
"Data" => $content,
|
||||
],
|
||||
]
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user