/***phpalapi接口:环信发送消息:通知发送私信*/
//Easemob.class.php位置:/data/wwwroot/twjs.yunbaozhibo.com/api/public/Easemob.class.php
public function sendHuanxinMsg($suid,$content){
//发送私信:环信*****************************************************************************
include "./Easemob.class.php";
$options['client_id']='YXA6QcGAQFMyEeeobPfK_z9yaw';
$options['client_secret']='YXA66j64tXNMOhe-SOVzKQiWZQdhIhU';
$options['org_name']='1181170617178219';
$options['app_name']='zhengapp';
$h=new \Easemob($options);
/* $js= $h->getUser("12663");//测试是否联通
file_put_contents('./huanxinp.txt',date('Y-m-d H:i:s').'提交参数信息 :'.json_encode($js)."\r\n",FILE_APPEND);
*/
if($suid){
$users=explode(",",$suid);
$count=count($users);
$nums=ceil($count/100);
for($i=0,$m=0;$i<$nums;$i++){
$target=array();
for($n=0;$n<100;$n++,$m++){
if($m==$count){
break;
}
$target[]=$users[$m];
}
try{
//发送文本消息: from:1:系统消息
$from='1';
$target_type="users";
//$target=array("1529","1527","1453");
$ext['isfollow']=1;
//**********************************正式投入放开下列代码*******************************************************************************
/* $result=$h->sendText($from,$target_type,$target,$content,$ext); */
}catch(Exception $e){
file_put_contents('./huanxinp.txt',date('Y-m-d H:i:s').'提交参数信息 :'.json_encode($e)."\r\n",FILE_APPEND);
}
}
}
}