فهرست منبع

Merge branch 'dev' of http://git.bocai108.com:10180/Ethan/Customer-Service into dev

Jonlin 6 سال پیش
والد
کامیت
586d2c9f21
1فایلهای تغییر یافته به همراه10 افزوده شده و 13 حذف شده
  1. 10 13
      vendor/GatewayWorker_windows/Applications/whisper/Events.php

+ 10 - 13
vendor/GatewayWorker_windows/Applications/whisper/Events.php

@@ -86,15 +86,15 @@ class Events
     public static function onConnect($client_id)
     {
         // 检测是否开启自动应答
-        $sayHello = self::$global->replay['1'];
-        if (!empty($sayHello) && 1 == $sayHello['status']) {
+        $sayHello = self::$global->systemReplay;
+        if (!empty($sayHello)) {
 
             $hello = [
                 'message_type' => 'helloMessage',
                 'data' => [
                     'name' => '智能助手',
                     'time' => date('H:i'),
-                    'content' => $sayHello['word']
+                    'content' => $sayHello
                 ]
             ];
             Gateway::sendToClient($client_id, json_encode($hello, 256));
@@ -444,12 +444,6 @@ class Events
             foreach ($oldService as $tmpcie => $tmpsid) {
                 $tmpserver = json_decode(self::$redis->hget(self::SERVICELOG, $tmpsid), true);
                 if (!$tmpserver) {
-                    echo "无退出11\n";
-                    continue;
-                }
-                $useronline = Gateway::isUidOnline($tmpserver['user_id']);
-                if (!$useronline) {
-                    echo "用户不在线退出22\n";
                     continue;
                 }
                 $tmpserver['kf_client_id'] = $clientid;
@@ -1033,7 +1027,7 @@ class Events
         ];
         self::MySendMsg($userInfo['client_id'], json_encode($noticeUser, 256));
 
-        $sayHello = (self::$global->replay)['2'];
+        $sayHello = (self::$global->kfReplay)[0];
         if (!empty($sayHello) && 1 == $sayHello['status'] && !$isChangeKF) {
             $chat_message = [
                 'message_type' => 'chatMessage',
@@ -1080,7 +1074,6 @@ class Events
     //连接至上一个会话
     private static function BeginOldTalk($kfuid, $uid, $group, $serviceid = 0, $userInfo = false)
     {
-        echo "BeginOldTalk " . print_r([$kfuid, $uid, $group, $serviceid, $userInfo], true) . "\n";
 
         $serviceid = intval($serviceid);
         $userInfo = json_decode(self::$redis->hget(self::USERINFOKEY, $uid), true);
@@ -1411,9 +1404,13 @@ class Events
         }
 
         $arr = [];
-        $systemReplay = self::$db->query('select * from `ws_reply` where `type`=1');
+        $systemReplay = self::$db->query('select * from `ws_reply` where `type`=1 order by `sort`');
         $kfReplay = self::$db->query('select * from `ws_reply` where `type`=2');
-        self::$global->systemReplay = $systemReplay;
+        $systemWelcome = [];
+        foreach ($systemReplay as $v) {
+            $systemWelcome[] = htmlspecialchars_decode($v['word']);
+        }
+        self::$global->systemReplay = $systemWelcome;
         self::$global->kfReplay = $kfReplay;
 
         $arr = [];