vali 6 lat temu
rodzic
commit
713a9451c9

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

@@ -627,6 +627,15 @@ class Events
             sleep(2);
             sleep(2);
         }
         }
 
 
+        $group = $message['group'];
+        $onlinekf = self::$global->kfList;
+        if (!isset($onlinekf[$group]) || count($onlinekf[$group]) <= 0) {
+            Gateway::sendToClient($client_id, json_encode(['message_type' => 'notice', 'content' => '暂时没有客服上班,请稍后再咨询。'], 256));
+            sleep(2);
+            Gateway::closeClient($client_id);
+            return;
+        }
+
         if (!array_key_exists($message['uid'], $userList)) {
         if (!array_key_exists($message['uid'], $userList)) {
             do {
             do {
                 $NewUserList = $userList;
                 $NewUserList = $userList;
@@ -809,6 +818,7 @@ class Events
                             'message_type' => 'userClose',
                             'message_type' => 'userClose',
                             'data' => [
                             'data' => [
                                 'content' => '用户连接已断开',
                                 'content' => '用户连接已断开',
+                                'id' => $uid,
                                 'time' => date('H:i'),
                                 'time' => date('H:i'),
                             ]
                             ]
                         ];
                         ];