vali 6 anni fa
parent
commit
0eef3c3e03

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

@@ -1131,6 +1131,7 @@ class Events
             'data' => [
                 'user_info' => $userInfo,
                 'conversationId' => $serviceid,
+                'history' => self::getServerChagLog($serviceid)
             ]
         ];
         self::MySendMsg($kfinfo['client_id'], json_encode($noticeKf, 256));
@@ -1142,6 +1143,15 @@ class Events
         return;
     }
 
+    //获取工单最后20条聊天记录
+    private static function getServerChagLog($sericeId, $limit = 20)
+    {
+        $ret = self::$db->select('from_id,from_name,to_id,to_name,content')->from('ws_chat_log')->where('servicelog_id=:sid')->bindValues(array('sid' => $sericeId))->orderByDESC(['id'])->limit($limit)->query();
+        if ($ret) {
+            rsort($ret);
+        }
+        return $ret;
+    }
 
     //用户排队数据  按组
     private static function getUserListData()