管理后台-封禁-调试

This commit is contained in:
2026-01-27 09:14:22 +08:00
parent 486f42bd5b
commit a38317a58c
2 changed files with 10 additions and 5 deletions

View File

@@ -278,7 +278,7 @@ class User extends adminApi
'Text' => $content
];
//谁发送给谁什么消息是否同步到发送者1是2否消息是否只下发给在线用户 1 是0 否
model('api/Tencent')->user_sendmsg("管理员",$user_id,json_encode($text));
model('api/Tencent')->user_sendmsg("administrator",$user_id,json_encode($text),2,0,1);
}else{
if($type ==1) {
$res = model('User')->where('id', $user_id)->update(['status' => 1]);

View File

@@ -399,18 +399,22 @@ class Tencent extends Model
}
//指定用户发送消息给用户
public function user_sendmsg($uid, $receive_uid, $message, $machine_type = 2, $OnlineOnlyFlag = 0){
public function user_sendmsg($uid, $receive_uid, $message, $machine_type = 2, $OnlineOnlyFlag = 0,$is_admin=0){
$config = get_system_config();
$tencentyun_im_appid = $config['tencentyun_im_appid'];
$im_admin = 'administrator';
$admin_sig = $this->tencent_user_sig_info($im_admin);
$rand = rand(111111111,9999999999);
if($is_admin == 1){
$from_Account ="administrator";
}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('u'.$uid),
'From_Account' => strval($from_Account),
'To_Account' => strval('u'.$receive_uid),
'MsgRandom' => time(),
'MsgBody' => array(
@@ -429,7 +433,8 @@ class Tencent extends Model
$curlPost = json_encode($curlPost);
$reslut = $this->tencent_post_url($postUrl, $curlPost);
Log::record("xitong消息信息2:".$reslut,"info");
print_r($reslut);die;
// Log::record("xitong消息信息2:".$reslut,"info");
return $reslut;
}