新增药师审核
This commit is contained in:
+36
-37
@@ -234,46 +234,45 @@ class ImService extends BaseService
|
||||
* @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);
|
||||
try {
|
||||
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',"ForbidAfterSendMsgCallback"];
|
||||
$arg['SendMsgControl'] = ['NoUnread'];
|
||||
|
||||
$arg['MsgBody'] = [
|
||||
[
|
||||
"MsgType" => $message_type,
|
||||
"MsgContent" => $message_content,
|
||||
]
|
||||
];
|
||||
|
||||
$arg['CloudCustomData'] = "";
|
||||
if (!empty($cloud_custom_data)){
|
||||
$arg['CloudCustomData'] = json_encode($cloud_custom_data,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
$message->sendMessage($arg);
|
||||
}catch (\Exception $e){
|
||||
throw new BusinessException($e->getMessage());
|
||||
} catch (GuzzleException $e) {
|
||||
throw new BusinessException($e->getMessage());
|
||||
}
|
||||
|
||||
// 检测并创建接收者资料
|
||||
$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',"ForbidAfterSendMsgCallback"];
|
||||
$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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user