Przeglądaj źródła

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

Jonlin 6 lat temu
rodzic
commit
5ae3b5b84f

+ 2 - 0
application/admin/controller/Report.php

@@ -205,6 +205,7 @@ class Report extends Base
             return $a['uid'] == $b['uid'] ? 0 : ($a['uid'] > $b['uid'] ? 1 : -1);
         });
 
+        
         foreach ($all_last as $key => $val) {
             $all_last[$key]['1'] = secendToHourMinit($all_last[$key]['1']);
             $all_last[$key]['2'] = secendToHourMinit($all_last[$key]['2']);
@@ -215,6 +216,7 @@ class Report extends Base
             unset($all_last[$key]['uid']);
             unset($all_last[$key]['0']);
         }
+        
 
         //导出数据
         if ($returnAll) {

+ 3 - 2
application/admin/view/report/attendancereport.html

@@ -65,12 +65,13 @@
                         <th data-field="day">日期</th>
                         <th data-field="of1">首次登陆时间</th>
                         <th data-field="of0">最后登出时间</th>
-                        <th data-field="1">登陆时长</th>
+                        <th data-field="1">在线时长</th>
                         <th data-field="3">休息时长</th>
                         <th data-field="2">隐身时长</th>
+                        <th data-field="all">总登陆时长</th>
                         <th data-field="s1p">在线占比</th>
-                        <th data-field="s3p">休息占比</th>
                         <th data-field="s2p">隐身占比</th>
+                        <th data-field="s3p">休息占比</th>
                         </thead>
                     </table>
                 </div>

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

@@ -229,6 +229,10 @@ class Events
                 case 'getkfonlines':
                     Gateway::sendToCurrentClient(json_encode(self::getkfonlines(), 256));
                     break;
+                case 'kfgetuserinfo':
+                    $tmp_id = isset($message['data']['id']) ? $message['data']['id'] : 0;
+                    self::kfgetuserinfo($client_id, intval($tmp_id));
+                    break;
                 case 'chatMessage':
                     $client = Gateway::getClientIdByUid($message['data']['to_id']);
                     if (!empty($client)) {
@@ -430,6 +434,15 @@ class Events
         }
     }
 
+    //得到一个用户详细信息
+    public static function kfgetuserinfo($clientid, $id)
+    {
+        $ret = self::$db->select('*')->from('ws_account')->where('id=:id')->bindValues(['id' => $id])->row();
+        Gateway::sendToClient($clientid, json_encode(['message_type' => 'userdetailinfo', 'data' => $ret]));
+        return;
+    }
+
+
     //获取在线客服列表
     public static function getkfonlines()
     {
@@ -437,7 +450,11 @@ class Events
             'message_type' => 'onlinekfs',
             'data' => [],
         ];
-        $nowkfid = $_SESSION['uid'];
+        $nowkfid = isset($_SESSION['uid']) ? $_SESSION['uid'] : 0;
+        $fromgrouupid = isset($_SESSION['uid']) ? $_SESSION['group'] : 0;
+        if (empty($grouupid) || empty($nowkfid)) {
+            return $return;
+        }
 
         $kfs = self::$global->kfList;
         $groupnamemap = self::$global->groupmap;
@@ -450,7 +467,7 @@ class Events
 
         foreach ($kfs as $gruop => $users) {
             foreach ($users as $uid => $uinfo) {
-                if ($uid != $nowkfid) {
+                if ($uid != $nowkfid && $fromgrouupid == $gruop) {
                     $ret[] = ['groupid' => $gruop, 'groupname' => $groupnamemap[$gruop], 'kfuid' => $uid, 'kfname' => $uinfo['name'], 'kfjobname' => $uinfo['job_name']];
                 }
             }
@@ -527,6 +544,7 @@ class Events
             return false;
         }
         self::$db->update('ws_service_log')->cols(['status' => 2, 'end_time' => time()])->where('servicelog_id=' . $oldlog['servicelog_id'])->query();
+        $tmp_old_service_logid = $oldlog['servicelog_id'];
         unset($oldlog['servicelog_id']);
 
         // 修改会话时长
@@ -570,7 +588,7 @@ class Events
         Gateway::sendToClient($tokfidclientid, json_encode($noticeKf, 256));
         unset($noticeKf);
 
-        self::servicetrutoother('OUT', $fromkfuid, $toukfid, $oldlog['servicelog_id'], $uid);
+        self::servicetrutoother('OUT', $fromkfuid, $toukfid, $tmp_old_service_logid, $uid);
         self::servicetrutoother('IN', $toukfid, $fromkfuid, $new_id, $uid);
 
         //回转接人,转接成功