Sfoglia il codice sorgente

'在线会话报警错误修改'

Ethan 6 anni fa
parent
commit
5d3024d1b5

+ 13 - 3
application/admin/controller/System.php

@@ -2,6 +2,7 @@
 namespace app\admin\controller;
 
 use app\admin\model\Office;
+use think\cache\driver\Redis;
 
 /**
  * 管理系统系统设置类
@@ -355,7 +356,7 @@ class System extends Base
     }
 
     // 历史会话记录详情
-    public function detail($id)
+    public function detail($id, $type='')
     {
         $chat = db('chat_log')->where('servicelog_id',$id)->order('time_line')->select();
         $html = '';
@@ -383,13 +384,22 @@ class System extends Base
             }
 
         }
-        $servicelog = db('service_log')->where('servicelog_id',$id)->find();
+        $redis = new Redis;
+        if ($type === 'onLine') {
+            $servicelog = json_decode($redis->handler()->Hget('SERVICELOG', $id), true);
+        } else {
+            $servicelog = db('service_log')->where('servicelog_id',$id)->find();
+        }
         //满意度
         $evaluate = db('evaluate')->where('evaluate_id',$servicelog['evaluate_id'])->find();
         $evaluate = '<img width="40px" style="margin-top:15px;" src="'.$evaluate['evaluate_url'].'"/>';
 
         //$alarm报警信息
-        $alarm =  db('alarm')->where('servicelog_id',$id)->find();
+        if ($type === 'onLine') {
+            $alarm = json_decode($redis->handler()->Hget('SERVICELOG', $id), true);
+        } else {
+            $alarm =  db('alarm')->where('servicelog_id',$id)->find();
+        }
 
         //会话超时标准
         $verifyAllTime =  db('systemconfig')->where('systemconfig_name','质检会话时长设置')->find();

+ 1 - 1
application/admin/view/index/index.html

@@ -415,7 +415,7 @@
                             "<td>"+customFormatDateTime(start_time,'',2)+"</td>" +
                             "<td>"+cvtList[key].allCount+"</td>" +
                             "<td>" +
-                                "<a href='/admin/system/detail/id/"+cvtList[key].servicelog_id+".html'>" +
+                                "<a href='/admin/system/detail/id/"+cvtList[key].servicelog_id+"/type/onLine.html'>" +
                                     "<button type='button' class='btn btn-primary btn-sm'>" +
                                         "<i class='fa fa-paste'></i> 详情" +
                                     "</button>" +

+ 3 - 3
thinkphp/library/think/cache/driver/Redis.php

@@ -23,10 +23,10 @@ use think\cache\Driver;
 class Redis extends Driver
 {
     protected $options = [
-        'host'       => '127.0.0.1',
-        'port'       => 6379,
+        'host'       => '192.168.2.200',
+        'port'       => 26379,
         'password'   => '',
-        'select'     => 0,
+        'select'     => 1,
         'timeout'    => 0,
         'expire'     => 0,
         'persistent' => false,