Browse Source

'修改转接有历史记录,修改可以查看客服状态'

Ethan 6 years ago
parent
commit
84b9627614

+ 4 - 1
application/service/controller/History.php

@@ -48,8 +48,11 @@ class History extends Common
                 foreach ($kefuInfo as $va) {
                     $kefuInfoData = json_decode($va, true);
                     if ($kefuInfoData['group'] == $v['id']) {
+                        $KFstatus = $kefuInfoData['status'] == 1 ? '在线'
+                            : ($kefuInfoData['status'] == 2 ? '隐身'
+                                : ($kefuInfoData['status'] == 3 ? '休息' : '未知'));
                         $data[$k]->children[$n] = (object) [
-                            'label' => $kefuInfoData['name'],
+                            'label' => $kefuInfoData['name'].$KFstatus,
                         ];
                         $m = 0;
                         $data[$k]->children[$n]->children = [];

+ 4 - 3
vendor/GatewayWorker_windows/Applications/whisper/Events.php

@@ -1051,7 +1051,7 @@ class Events
     }
 
     //开启一个会话
-    private static function BeginTalk($kfuid, $uid, $group, $serviceid = 0, $userInfo = false, $isChangeKF = 0)
+    private static function BeginTalk($kfuid, $uid, $group, $serviceid = 0, $userInfo = false, $isChangeKF = 0, $oldChatLog = [])
     {
 
         $serviceid = intval($serviceid);
@@ -1151,7 +1151,7 @@ class Events
             'data' => [
                 'user_info' => $userInfo,
                 'conversationId' => $serviceid,
-                'history' => [],
+                'history' => $oldChatLog,
                 'evaluate_id' => 0,
             ]
         ];
@@ -1733,6 +1733,7 @@ class Events
 
         /////////取消原有会话,开启新会话
         $oldlog = self::$db->select('*')->from('ws_service_log')->where('servicelog_id=:servicelog_id ')->bindValues(['servicelog_id' => $serviceid])->orderByDESC(['servicelog_id'])->row();
+        $oldChatLog = self::$db->query("SELECT * FROM `ws_chat_log` where `servicelog_id`= '$serviceid' order by `time_line`");
         if (!$oldlog) {
             self::DebugOut('changeOtherhKeFu exit5...');
             return false;
@@ -1745,7 +1746,7 @@ class Events
         ///更新redis数据
         self::updteKfTasksByservicd($fromkfuid, $serviceid, $user_info['client_id'], 0);
 
-        self:: BeginTalk($toukfid, $uid, $groupidto, 0, $user_info, 1);
+        self:: BeginTalk($toukfid, $uid, $groupidto, 0, $user_info, 1, $oldChatLog);
         self::servicetrutoother('OUT', $fromkfuid, $toukfid, $serviceid, $uid);
         $newUserInfo = json_decode(self::$redis->hget(self::USERINFOKEY, $uid), true);
         self::servicetrutoother('IN', $toukfid, $fromkfuid, $newUserInfo['serverid'], $uid);