浏览代码

'管理员登陆,发送实时信息给管理员,会话超时退出'

Ethan 6 年之前
父节点
当前提交
1ede126b16
共有 1 个文件被更改,包括 11 次插入5 次删除
  1. 11 5
      vendor/GatewayWorker_windows/Applications/whisper/Events.php

+ 11 - 5
vendor/GatewayWorker_windows/Applications/whisper/Events.php

@@ -220,7 +220,7 @@ class Events
             Gateway::sendToClient($data['kf_client_id'], json_encode($chat_message));
         }
         // 保存修改后的工单信息.
-        $redis->HSET('SERVICELOG', $message['conversationId'], $data);
+        self::$redis->HSET('SERVICELOG', $message['conversationId'], $data);
 
         // 聊天信息入库
         $insertChatData = [
@@ -648,12 +648,18 @@ class Events
         $kfInfo = json_decode(self::$redis->HGET('KFINFO', 'KF'.$data['kf_id']), true);
         // 删除当前工单.
         //self::$redis->hdel('SERVICELOG', $servicelogId);
+        // 当前服务客服删除当前人员.
         $kfUserList = self::ArrayDataopt($kfInfo['user_info'], $kfInfo['client_id'], 0);
-        print_r([$kfInfo,$servicelogId,$kfUserList]);die;
-        $kfInfo[''] = 1;
-        //$redis->HSET('SERVICELOG', $message['conversationId'], $data);
+        if (isset($kfInfo)) {
+            print_r([$kfInfo,$servicelogId]);die;
+        }
+        // 当前客服所接待人员.
+        $kfInfo['user_info'] = $kfUserList;
+        $kfInfo['task'] = count($kfUserList);
+        // 存入客服信息.
+        $redis->HSET('KFINFO', 'KF'.$data['kf_id'], $kfInfo);
+        // 将数据存入数据库.
 
-        //print_r($data);
 
     }