From 210a32568874f714d7359424fdaa1badca48531f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Tue, 27 Jan 2026 10:09:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0-=E5=B0=81?= =?UTF-8?q?=E7=A6=81-=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Tencent.php | 48 +++++++++++++++++++------------ 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/application/api/model/Tencent.php b/application/api/model/Tencent.php index d5a0aa8a..0711e2f2 100644 --- a/application/api/model/Tencent.php +++ b/application/api/model/Tencent.php @@ -405,34 +405,44 @@ class Tencent extends Model $im_admin = 'administrator'; $admin_sig = $this->tencent_user_sig_info($im_admin); $rand = rand(111111111,9999999999); + $postUrl = 'https://console.tim.qq.com/v4/openim/sendmsg?sdkappid='.$tencentyun_im_appid.'&identifier='.$im_admin.'&usersig='.$admin_sig.'&random='.$rand.'&contenttype=json'; if($uid == 'administrator'){ $from_Account ="administrator"; + $curlPost = array( + 'SyncOtherMachine' => $machine_type, + 'From_Account' => strval($from_Account), + 'To_Account' => strval('u'.$receive_uid), + 'MsgRandom' => time(), + 'MsgBody' => array( + array( + 'MsgType' => 'TIMCustomElem', + 'MsgContent' => array( + 'Data' => $message, + ) + ) + ), + 'SendMsgControl' => array( + "NoUnread","NoLastMsg","WithMuteNotifications","NoMsgCheck" + ), + ); }else{ $from_Account ="u".$uid; - } - $postUrl = 'https://console.tim.qq.com/v4/openim/sendmsg?sdkappid='.$tencentyun_im_appid.'&identifier='.$im_admin.'&usersig='.$admin_sig.'&random='.$rand.'&contenttype=json'; - - $curlPost = array( - 'SyncOtherMachine' => $machine_type, - 'From_Account' => strval($from_Account), - 'To_Account' => strval('u'.$receive_uid), - 'MsgRandom' => time(), - 'MsgBody' => array( - array( - 'MsgType' => 'TIMTextElem', - 'MsgContent' => array( - 'Text' => $message, + $curlPost = array( + 'SyncOtherMachine' => $machine_type, + 'From_Account' => strval($from_Account), + 'To_Account' => strval('u'.$receive_uid), + 'MsgRandom' => time(), + 'MsgBody' => array( + array( + 'MsgType' => 'TIMTextElem', + 'MsgContent' => array( + 'Text' => $message, ), ), ), - ); - if($uid == 'administrator'){ - $curlPost['MsgBody']['MsgType'] = 'TIMCustomElem'; - $curlPost['MsgBody']['MsgContent']['Data'] = $message; - $curlPost['SendMsgControl'] = array( - "NoUnread","NoLastMsg","WithMuteNotifications","NoMsgCheck" ); } + if($OnlineOnlyFlag == 1){ $curlPost['OnlineOnlyFlag'] = 1; }