|
|
@@ -31,8 +31,16 @@ class ChatController extends BaseController
|
|
|
$clientId = isset($post['clientId']) ? $post['clientId'] : '';
|
|
|
$id = 'merchantChat_' . $this->merchantId;
|
|
|
Gateway::bindUid($clientId, $id);
|
|
|
+
|
|
|
+ //连接就将新消息置为已读
|
|
|
+ $consoleId = 'merchantConsole_' . $this->merchantId;
|
|
|
+ $consoleOnline = Gateway::getClientIdByUid($consoleId);
|
|
|
+ if ($consoleOnline) {
|
|
|
+ $data = ['type' => 'newMessage', 'status' => 0];
|
|
|
+ Gateway::sendToUid($consoleId, json_encode($data));
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//关闭当前链接
|
|
|
public function actionClose()
|
|
|
{
|