|
@@ -48,6 +48,7 @@ class imsocket extends Server
|
|
|
|
|
|
//绑定用户
|
|
|
if($arr->type == "bind" && !isset($connection->uid)){
|
|
|
+ //print_r($arr);
|
|
|
$connection->uid = $arr->uid;
|
|
|
$this->connectionUid = $arr->uid;
|
|
|
//保存uid到connection的映射,实现针对特定uid的推送
|
|
@@ -57,7 +58,7 @@ class imsocket extends Server
|
|
|
if($arr->school_id){
|
|
|
//如果是学校的话,返回一个老师的id给他。
|
|
|
|
|
|
- $tsql="SELECT u.user_id,u.user_type,u.real_name FROM yoshop_user_info i JOIN yoshop_user u ON i.user_id = u.user_id WHERE u.user_type=3 AND u.is_delete=0 AND i.school_id=".$arr->school_id." AND i.status=1";
|
|
|
+ $tsql="SELECT u.user_id,u.user_type,u.real_name,u.nick_name FROM yoshop_user_info i JOIN yoshop_user u ON i.user_id = u.user_id WHERE u.user_type=3 AND u.is_delete=0 AND i.school_id=".$arr->school_id." AND i.status=1";
|
|
|
$resT=$db->query($tsql);
|
|
|
if($resT->num_rows > 0) {
|
|
|
$tempList=[];
|
|
@@ -65,6 +66,7 @@ class imsocket extends Server
|
|
|
|
|
|
$temp['uid']= $row['user_id'];
|
|
|
$temp['uname']= $row['real_name'];
|
|
|
+ $temp['nick_name']= $row['nick_name'];
|
|
|
$temp['utype']= $row['user_type'];
|
|
|
if(isset($this->worker->uidConnections[$row['user_id']])){
|
|
|
//是否在线,在线加权重
|
|
@@ -88,7 +90,7 @@ class imsocket extends Server
|
|
|
$one = $tempdata[$use];
|
|
|
|
|
|
|
|
|
- $msg=['type'=>'bind','fansinfo'=>['uid'=>$one['uid'],'uname'=>$one['uname']]];
|
|
|
+ $msg=['type'=>'bind','fansinfo'=>['uid'=>$one['uid'],'uname'=>$one['uname'],'nick_name'=>$one['nick_name']]];
|
|
|
|
|
|
}else{
|
|
|
$msg=['type'=>'bind','fansinfo'=>''];
|
|
@@ -103,6 +105,7 @@ class imsocket extends Server
|
|
|
|
|
|
//聊天
|
|
|
if($arr->type=="text"){
|
|
|
+ //print_r($arr);
|
|
|
|
|
|
//先进库
|
|
|
$insetSql="INSERT INTO yoshop_imchat (from_user_id,to_user_id,message,school_id,speciality_id,sendtime,chat_key,is_push)
|