Просмотр исходного кода

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

vali 6 лет назад
Родитель
Сommit
8e03276e38
31 измененных файлов с 201 добавлено и 99 удалено
  1. 14 2
      application/admin/controller/Robot.php
  2. 22 2
      application/admin/controller/Sensitivec.php
  3. 1 10
      application/admin/controller/Settings.php
  4. 8 6
      application/admin/controller/System.php
  5. 1 1
      application/admin/controller/Users.php
  6. 15 1
      application/admin/controller/Words.php
  7. 2 2
      application/admin/view/accounts/label.html
  8. 2 2
      application/admin/view/admins/index.html
  9. 2 2
      application/admin/view/admins/power.html
  10. 2 2
      application/admin/view/groups/index.html
  11. 1 1
      application/admin/view/index/index.html
  12. 2 2
      application/admin/view/kfnotice/index.html
  13. 1 1
      application/admin/view/kfonitoring/cpkfjiankong.html
  14. 2 2
      application/admin/view/kfonitoring/index.html
  15. 2 2
      application/admin/view/menu/index.html
  16. 2 2
      application/admin/view/messages/index.html
  17. 2 2
      application/admin/view/messages/type.html
  18. 1 1
      application/admin/view/report/attendancereport.html
  19. 1 1
      application/admin/view/reportForm/index.html
  20. 26 7
      application/admin/view/robot/index.html
  21. 39 8
      application/admin/view/sensitivec/index.html
  22. 1 7
      application/admin/view/settings/add.html
  23. 2 8
      application/admin/view/settings/edit.html
  24. 2 2
      application/admin/view/settings/index.html
  25. 5 5
      application/admin/view/system/basics.html
  26. 3 3
      application/admin/view/system/conversation.html
  27. 1 1
      application/admin/view/users/adduser.html
  28. 2 2
      application/admin/view/users/edituser.html
  29. 2 2
      application/admin/view/users/index.html
  30. 29 6
      application/admin/view/words/index.html
  31. 6 4
      vendor/GatewayWorker_windows/Applications/whisper/Events.php

+ 14 - 2
application/admin/controller/Robot.php

@@ -3,14 +3,13 @@ namespace app\admin\controller;
 
 use think\Loader;
 use think\Controller;
-
+use think\Db;
 /**
  * 智能问答类
  */
 class Robot extends Base
 {
 
-
     /**
      * 智能问答列表
      *
@@ -167,6 +166,19 @@ class Robot extends Base
         }
     }
 
+    // 删除全部智能问答
+    public function delAll()
+    {
+        if(request()->isAjax()){
+            try{
+                Db::execute("truncate table ws_robot");
+            }catch(\Exception $e){
+                return json(['code' => -1, 'data' => '', 'msg' => $e->getMessage()]);
+            }
+            return json(['code' => 1, 'data' => '', 'msg' => '删除全部智能问答成功']);
+        }
+    }
+
     // 生成按钮
     private function makeBtn($id)
     {

+ 22 - 2
application/admin/controller/Sensitivec.php

@@ -90,8 +90,9 @@ class Sensitivec extends Base
             $param = input('post.');
 
             // 检测用户修改的管理员是否重复
-            $has = db('sensitivewords')->where('sensitivewords_word', $param['sensitivewords_word'])->where('sensitivewords_id', '<>', $param['sensitivewords_id'])->find();
-            if(!empty($has)){
+            $has = db('sensitivewords')->where('sensitivewords_word', $param['sensitivewords_word'])->find();
+            $thisWord = db('sensitivewords')->where('sensitivewords_id', $param['sensitivewords_id'])->find();
+            if(!empty($has) && $has['sensitivewords_id'] != $param['sensitivewords_id'] && $thisWord['sensitivewords_for'] == $has['sensitivewords_for']){
                 return json(['code' => -1, 'data' => '', 'msg' => '该敏感词已经存在']);
             }
 
@@ -133,6 +134,25 @@ class Sensitivec extends Base
         }
     }
 
+    //删除所有关键字
+    public function delAll(){
+        if(request()->isAjax()){
+            $type = input('param.type/d');
+            if($type == 1){
+                $name = '用户';
+            }
+            if($type == 2){
+                $name = '客服';
+            }
+            try{
+                db('sensitivewords')->where('sensitivewords_for', $type)->delete();
+            }catch(\Exception $e){
+                return json(['code' => -1, 'data' => '', 'msg' => $e->getMessage()]);
+            }
+            return json(['code' => 1, 'data' => '', 'msg' => '删除全部'.$name.'敏感词成功']);
+        }
+    }
+
     // 生成按钮
     private function makeBtn($id)
     {

+ 1 - 10
application/admin/controller/Settings.php

@@ -28,7 +28,7 @@ class Settings extends Base
             $group = db('groups')->select();
             foreach($result as $key=>$vo){
                 // 优化显示头像
-                $result[$key]['image'] = '<img src="' . $vo['image'] . '" width="40px" height="40px">';
+                $result[$key]['image'] = '<img src="' . $vo['image'] . '" height="40px">';
 
                 if($vo['group_id'] == 'all'){
                     $result[$key]['user_group'] = '所有客服组';
@@ -78,10 +78,6 @@ class Settings extends Base
                 return json(['code' => -8, 'data' => '', 'msg' => '名称字数超过限制']);
             }
 
-            if(!is_numeric($param['margin_top'])) {
-                return json(['code' => -7, 'data' => '', 'msg' => '上边距未输入整数']);
-            }
-
             if(!is_numeric($param['sort'])) {
                 return json(['code' => -6, 'data' => '', 'msg' => '排序未输入整数']);
             }
@@ -123,10 +119,6 @@ class Settings extends Base
                 return json(['code' => -8, 'data' => '', 'msg' => '名称字数超过限制']);
             }
 
-            if(!is_numeric($param['margin_top'])) {
-                return json(['code' => -7, 'data' => '', 'msg' => '上边距未输入整数']);
-            }
-
             if(!is_numeric($param['sort'])) {
                 return json(['code' => -6, 'data' => '', 'msg' => '排序未输入整数']);
             }
@@ -143,7 +135,6 @@ class Settings extends Base
             $info = array();
             $info['name'] = $param['name'];
             $info['image'] = $param['image'];
-            $info['margin_top'] = $param['margin_top'];
             $info['group_id'] = $param['group_id'];
             $info['sort'] = $param['sort'];
 

+ 8 - 6
application/admin/controller/System.php

@@ -89,12 +89,14 @@ class System extends Base
 
             try {
                 // 修改会话超时.
-                $updateOvertimeData['systemconfig_data'] = $param['overtime'];
-                $updateOvertimeWhere['systemconfig_id']  = 1;
+                $updateOvertimeData['systemconfig_data']    = $param['overtime'];
+                $updateOvertimeData['systemconfig_content'] = $param['overtimeInfo'];
+                $updateOvertimeWhere['systemconfig_id']     = 1;
                 model('Systemconfig')->updateSystemconfig($updateOvertimeWhere, $updateOvertimeData);
                 // 修改访客静默.
-                $upUptdData['systemconfig_data'] = $param['unoperated'];
-                $upUptdWhere['systemconfig_id']  = 2;
+                $upUptdData['systemconfig_data']    = $param['unoperated'];
+                $upUptdData['systemconfig_content'] = $param['unoperatedInfo'];
+                $upUptdWhere['systemconfig_id']     = 2;
                 model('Systemconfig')->updateSystemconfig($upUptdWhere, $upUptdData);
                 // 质检会话时长设置.
                 $upAllTimeData['systemconfig_data'] = $param['verifyAllTime'];
@@ -287,10 +289,10 @@ class System extends Base
                     $result[$key]['servicelog_close_type'] = '未知';
                 }
                 if($vo['servicelog_close_type'] == 1){
-                    $result[$key]['servicelog_close_type'] = '访客静默';
+                    $result[$key]['servicelog_close_type'] = '无效会话';
                 }
                 if($vo['servicelog_close_type'] == 2){
-                    $result[$key]['servicelog_close_type'] = '会话超时';
+                    $result[$key]['servicelog_close_type'] = '双方静默';
                 }
                 if($vo['servicelog_close_type'] == 3){
                     $result[$key]['servicelog_close_type'] = '客服关闭';

+ 1 - 1
application/admin/controller/Users.php

@@ -34,7 +34,7 @@ class Users extends Base
             $result = db('users')->where($where)->limit($offset, $limit)->order('id', 'desc')->select();
             foreach($result as $key=>$vo){
                 // 优化显示头像
-                $result[$key]['user_avatar'] = '<img src="' . $vo['user_avatar'] . '" width="40px" height="40px">';
+                $result[$key]['user_avatar'] = '<img src="' . $vo['user_avatar'] . '" height="40px">';
 
                 // 优化显示状态
                 if(1 == $vo['status']){

+ 15 - 1
application/admin/controller/Words.php

@@ -123,7 +123,7 @@ class Words extends Base
         return $this->fetch('editword');
     }
 
-    // 删除常用语
+    // 删除快捷回复
     public function delWord()
     {
         if(request()->isAjax()){
@@ -139,6 +139,20 @@ class Words extends Base
         }
     }
 
+    // 删除全部快捷回复
+    public function delAll()
+    {
+        if(request()->isAjax()){
+            try{
+                db('words')->where('user_id',0)->delete();
+            }catch(\Exception $e){
+                return json(['code' => -1, 'data' => '', 'msg' => $e->getMessage()]);
+            }
+
+            return json(['code' => 1, 'data' => '', 'msg' => '删除全部快捷回复成功']);
+        }
+    }
+
     // 生成按钮
     private function makeBtn($id)
     {

+ 2 - 2
application/admin/view/accounts/label.html

@@ -58,9 +58,9 @@
             url: "{:url('accounts/label')}", //获取数据的地址
             striped: true,  //表格显示条纹
             pagination: true, //启动分页
-            pageSize: 10,  //每页显示的记录数
+            pageSize: 50,  //每页显示的记录数
             pageNumber:1, //当前第几页
-            pageList: [10,20],  //记录数可选列表
+            pageList: [20,50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",

+ 2 - 2
application/admin/view/admins/index.html

@@ -74,9 +74,9 @@
             url: "{:url('admins/index')}", //获取数据的地址
             striped: true,  //表格显示条纹
             pagination: true, //启动分页
-            pageSize: 10,  //每页显示的记录数
+            pageSize: 50,  //每页显示的记录数
             pageNumber:1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",

+ 2 - 2
application/admin/view/admins/power.html

@@ -58,9 +58,9 @@
             url: "{:url('admins/power')}", //获取数据的地址
             striped: true,  //表格显示条纹
             pagination: true, //启动分页
-            pageSize: 10,  //每页显示的记录数
+            pageSize: 50,  //每页显示的记录数
             pageNumber:1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",

+ 2 - 2
application/admin/view/groups/index.html

@@ -72,9 +72,9 @@
             url: "{:url('groups/index')}", //获取数据的地址
             striped: true,  //表格显示条纹
             pagination: true, //启动分页
-            pageSize: 10,  //每页显示的记录数
+            pageSize: 50,  //每页显示的记录数
             pageNumber:1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",

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

@@ -297,7 +297,7 @@
             pagination: true, //启动分页
             pageSize: 50,  //每页显示的记录数
             pageNumber: 1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",

+ 2 - 2
application/admin/view/kfnotice/index.html

@@ -126,9 +126,9 @@
             url: "{:url('kfnotice/index')}", //获取数据的地址
             striped: true,  //表格显示条纹
             pagination: true, //启动分页
-            pageSize: 10,  //每页显示的记录数
+            pageSize: 50,  //每页显示的记录数
             pageNumber: 1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",

+ 1 - 1
application/admin/view/kfonitoring/cpkfjiankong.html

@@ -102,7 +102,7 @@
             pagination: true, //启动分页
             pageSize: 50,  //每页显示的记录数
             pageNumber: 1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",

+ 2 - 2
application/admin/view/kfonitoring/index.html

@@ -69,9 +69,9 @@
             url: "{:url('kfnotice/index')}", //获取数据的地址
             striped: true,  //表格显示条纹
             pagination: true, //启动分页
-            pageSize: 10,  //每页显示的记录数
+            pageSize: 50,  //每页显示的记录数
             pageNumber:1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",

+ 2 - 2
application/admin/view/menu/index.html

@@ -59,9 +59,9 @@
             url: "{:url('menu/index')}", //获取数据的地址
             striped: true,  //表格显示条纹
             pagination: true, //启动分页
-            pageSize: 10,  //每页显示的记录数
+            pageSize: 50,  //每页显示的记录数
             pageNumber:1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",

+ 2 - 2
application/admin/view/messages/index.html

@@ -144,9 +144,9 @@
             url: "{:url('messages/index')}", //获取数据的地址
             striped: true,  //表格显示条纹
             pagination: true, //启动分页
-            pageSize: 10,  //每页显示的记录数
+            pageSize: 50,  //每页显示的记录数
             pageNumber:1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",

+ 2 - 2
application/admin/view/messages/type.html

@@ -73,9 +73,9 @@
             url: "{:url('messages/type')}", //获取数据的地址
             striped: true,  //表格显示条纹
             pagination: true, //启动分页
-            pageSize: 10,  //每页显示的记录数
+            pageSize: 50,  //每页显示的记录数
             pageNumber:1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",

+ 1 - 1
application/admin/view/report/attendancereport.html

@@ -112,7 +112,7 @@
             pagination: true, //启动分页
             pageSize: 50,  //每页显示的记录数
             pageNumber: 1, //当前第几页
-            pageList: [20, 50, 100],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",

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

@@ -287,7 +287,7 @@
             pagination: true, //启动分页
             pageSize: 50,  //每页显示的记录数
             pageNumber: 1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",

+ 26 - 7
application/admin/view/robot/index.html

@@ -20,11 +20,14 @@
         </div>
         <div class="ibox-content">
             <a href="/admin/robot/addword.html">
-                <button class="btn btn-primary" type="button" style="margin-top:5px"><strong>新 增</strong>
+                <button class="btn btn-primary" type="button" style="margin-top:10px"><strong>新增智能问答</strong>
                 </button>
             </a>
             <form action="/admin/robot/inserExcel" enctype="multipart/form-data" method="post" role="form" class="form-inline pull-right">
-                <div class="content clearfix m-b" style="margin-left: 30px;">
+                <div class="content clearfix m-b">
+                    <div class="form-group">
+                        <a href="javascript:allDel()" class="btn" style="margin-top:5px;" ><button type="button" class="btn btn-danger btn-sm"><i class="fa fa-trash-o"></i>全部删除</button></a>
+                    </div>
                     <div class="form-group">
                         <a href="/static/admin/file/robot.xlsx" class="btn btn-primary" style="margin-top:5px" >下载智能问答模板文件</a>
                     </div>
@@ -40,9 +43,9 @@
             <!--搜索框开始-->
             <form id='commentForm' role="form" method="post" class="form-inline pull-right">
                 <input style="display: none">
-                <div class="content clearfix m-b">
+                <div class="content clearfix m-b" style="margin-top:5px">
                     <div class="form-group">
-                        <label>问题关键字:</label>
+                        <label>问题:</label>
                         <input type="text" class="form-control" id="content" name="content">
                     </div>
                     <div class="form-group">
@@ -92,9 +95,9 @@
             url: "{:url('robot/index')}", //获取数据的地址
             striped: true,  //表格显示条纹
             pagination: true, //启动分页
-            pageSize: 10,  //每页显示的记录数
+            pageSize: 50,  //每页显示的记录数
             pageNumber:1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",
@@ -143,10 +146,26 @@
                     layer.alert(res.msg, {title: '友情提示', icon: 2});
                 }
             });
-
             layer.close(index);
         })
+    }
 
+    function allDel(){
+        layer.confirm('确认删除全部智能问答?', {icon: 3, title:'提示'}, function(index){
+            //do something
+            $.getJSON("{:url('robot/delAll')}", function(res){
+                if(1 == res.code){
+                    layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
+                        initTable();
+                    });
+                }else if(111 == res.code){
+                    window.location.reload();
+                }else{
+                    layer.alert(res.msg, {title: '友情提示', icon: 2});
+                }
+            });
+            layer.close(index);
+        })
     }
 </script>
 </body>

+ 39 - 8
application/admin/view/sensitivec/index.html

@@ -28,28 +28,31 @@
         </div>
         <div class="ibox-content">
             <a id="add" href="/admin/sensitivec/addsensitive.html?type=2">
-                <button class="btn btn-primary" type="button" style="margin-top:5px"><strong>新 增</strong>
+                <button class="btn btn-primary" type="button" style="margin-top:10px"><strong>新增敏感词</strong>
                 </button>
             </a>
             <form action="/admin/sensitivec/inserExcel" enctype="multipart/form-data" method="post" role="form" class="form-inline pull-right">
-                <div class="content clearfix m-b" style="margin-left: 50px;">
+                <div class="content clearfix m-b">
+                    <div class="form-group" style="margin-left: 20px">
+                        <a href="javascript:allDel()" class="btn" style="margin-top:5px;" ><button type="button" class="btn btn-danger btn-sm"><i class="fa fa-trash-o"></i>全部删除</button></a>
+                    </div>
                     <div class="form-group">
-                        <a href="/static/admin/file/sensitivewords.xlsx" class="btn btn-primary" style="margin-top:5px" >下载敏感词模板文件</a>
+                        <a href="/static/admin/file/sensitivewords.xlsx" class="btn btn-primary"  >下载敏感词模板文件</a>
                     </div>
                     <div class="form-group">
                         <!--<label>导入敏感词:</label>-->
                         <input type="file" class="form-control" name="excel" style="width: 200px;border: none;" />
                     </div>
                     <div class="form-group">
-                        <input type="submit" class="btn btn-primary" style="margin-top:5px" value="导入">
+                        <input type="submit" class="btn btn-primary"  value="导入">
                     </div>
                 </div>
             </form>
             <!--搜索框开始-->
             <form id='commentForm' role="form" method="post" class="form-inline pull-right">
-                <div class="content clearfix m-b">
+                <div class="content clearfix m-b" style="margin-top: 5px;">
                     <div class="form-group">
-                        <label>敏感词关键字:</label>
+                        <label>敏感词:</label>
                         <input type="text" class="form-control" id="content" name="content" value="" placeholder="请输入敏感词">
                         <input style="display: none">
                     </div>
@@ -111,9 +114,9 @@
             url: "{:url('sensitivec/index')}", //获取数据的地址
             striped: true,  //表格显示条纹
             pagination: true, //启动分页
-            pageSize: 10,  //每页显示的记录数
+            pageSize: 50,  //每页显示的记录数
             pageNumber:1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",
@@ -184,6 +187,34 @@
         })
 
     }
+
+    function allDel(){
+        var type = $('#type').val();
+        var name = '';
+        if(type == 1){
+            name = '用户';
+        }
+        if(type == 2){
+            name = '客服';
+        }
+        layer.confirm('确认删除全部'+name+'敏感词?', {icon: 3, title:'提示'}, function(index){
+            //do something
+            $.getJSON("{:url('sensitivec/delAll')}", {'type' : type}, function(res){
+                if(1 == res.code){
+                    layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
+                        initTable();
+                    });
+                }else if(111 == res.code){
+                    window.location.reload();
+                }else{
+                    layer.alert(res.msg, {title: '友情提示', icon: 2});
+                }
+            });
+
+            layer.close(index);
+        })
+
+    }
 </script>
 </body>
 </html>

+ 1 - 7
application/admin/view/settings/add.html

@@ -28,12 +28,6 @@
                                 <input id="name" type="text" class="form-control" name="name" required="" aria-required="true" placeholder="最多输入四个中文汉字">
                             </div>
                         </div>
-                        <div class="form-group">
-                            <label class="col-sm-3 control-label">上边距(px):</label>
-                            <div class="input-group col-sm-4">
-                                <input id="margin_top" type="text" class="form-control" name="margin_top" required="" aria-required="true" placeholder="请输入整数">
-                            </div>
-                        </div>
                         <div class="form-group">
                             <label class="col-sm-3 control-label">排列顺序:</label>
                             <div class="input-group col-sm-4">
@@ -100,7 +94,7 @@
             ,done: function(res){
                 //上传完毕回调
                 if(0 == res.code){
-                    $("#images").html('<img src="' + res.data.src + '" width="50px" height="50px">');
+                    $("#images").html('<img src="' + res.data.src + '" height="40px">');
                     $("#image").val(res.data.src);
                 }else{
                     layer.msg(res.msg);

+ 2 - 8
application/admin/view/settings/edit.html

@@ -28,12 +28,6 @@
                                 <input id="name" type="text" class="form-control" name="name" required="" aria-required="true" value="{$info['name']}">
                             </div>
                         </div>
-                        <div class="form-group">
-                            <label class="col-sm-3 control-label">上边距(px):</label>
-                            <div class="input-group col-sm-4">
-                                <input id="margin_top" type="text" class="form-control" name="margin_top" required="" aria-required="true" value="{$info['margin_top']}">
-                            </div>
-                        </div>
                         <div class="form-group">
                             <label class="col-sm-3 control-label">排序:</label>
                             <div class="input-group col-sm-4">
@@ -63,7 +57,7 @@
                             </div>
                             <span>建议上传42px*42px</span>
                             <div class="input-group col-sm-3" id="images">
-                                <img src="{$info['image']}" width="40px" height="40px"/>
+                                <img src="{$info['image']}" height="40px"/>
                             </div>
                         </div>
 
@@ -102,7 +96,7 @@
             ,done: function(res){
                 //上传完毕回调
                 if(0 == res.code){
-                    $("#images").html('<img src="' + res.data.src + '" width="50px" height="50px">');
+                    $("#images").html('<img src="' + res.data.src + '" height="40px">');
                     $("#image").val(res.data.src);
                 }else{
                     layer.msg(res.msg);

+ 2 - 2
application/admin/view/settings/index.html

@@ -137,9 +137,9 @@
             url: "{:url('settings/index')}", //获取数据的地址
             striped: true,  //表格显示条纹
             pagination: true, //启动分页
-            pageSize: 10,  //每页显示的记录数
+            pageSize: 50,  //每页显示的记录数
             pageNumber:1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",

+ 5 - 5
application/admin/view/system/basics.html

@@ -54,7 +54,7 @@
                             </div>
                             <span>建议上传420px*700px</span>
                             <div class="input-group col-sm-3" id="avatar">
-                                <img src="{$advertisement['advertisement_img']}" width="40px" height="40px"/>
+                                <img src="{$advertisement['advertisement_img']}" height="40px"/>
                             </div>
 
                         </div>
@@ -69,7 +69,7 @@
                             </div>
                         </div>
 
-                        <h4 style="margin-bottom: 10px; margin-top: 40px">logo设置</h4>
+                        <h4 style="margin-bottom: 10px; margin-top: 40px">企业logo设置</h4>
                         <div class="ibox-title">
                         </div>
                         <div class="form-group layui-form-item form-inline" style="height: 60px;">
@@ -81,7 +81,7 @@
                             </div>
                             <span>建议上传70px*70px</span>
                             <div class="input-group col-sm-3" id="logo">
-                                <img src="{$settings['logo']}" width="40px" height="40px"/>
+                                <img src="{$settings['logo']}" height="40px"/>
                             </div>
                         </div>
 
@@ -119,7 +119,7 @@
             ,done: function(res){
                 //上传完毕回调
                 if(0 == res.code){
-                    $("#avatar").html('<img src="' + res.data.src + '" width="50px" height="50px">');
+                    $("#avatar").html('<img src="' + res.data.src + '" height="40px">');
                     $("#advertisement_img").val(res.data.src);
                 }else{
                     layer.msg(res.msg);
@@ -137,7 +137,7 @@
             ,done: function(res){
                 //上传完毕回调
                 if(0 == res.code){
-                    $("#logo").html('<img src="' + res.data.src + '" width="50px" height="50px">');
+                    $("#logo").html('<img src="' + res.data.src + '" height="40px">');
                     $("#logo_img").val(res.data.src);
                 }else{
                     layer.msg(res.msg);

+ 3 - 3
application/admin/view/system/conversation.html

@@ -21,7 +21,7 @@
                 </div>
                 <div class="ibox-content">
                     <form class="form-horizontal m-t layui-form" id="commentForm" method="post" action="{:url('system/conversation')}">
-                        <h4 style="margin-bottom: 10px;">会话超时设置</h4>
+                        <h4 style="margin-bottom: 10px;">双方静默超时设置</h4>
                         <div class="ibox-title">
                         </div>
                         <div class="form-group" style="flex-wrap: wrap; display: flex">
@@ -39,11 +39,11 @@
                             </div>
                         </div>
 
-                        <h4 style="margin-bottom: 10px; margin-top: 40px">访客静默设置</h4>
+                        <h4 style="margin-bottom: 10px; margin-top: 40px">无效会话关闭设置</h4>
                         <div class="ibox-title">
                         </div>
                         <div class="form-group" style="flex-wrap: wrap; display: flex">
-                            <p style="width: 100%; margin-left: 20px; color: #9c9c9c; margin-bottom: 15px; font-size: 15px;">访客开启会话框后,在设置的时间内,没有任何操作,系统将发出提示语并立即关闭对话。</p>
+                            <p style="width: 100%; margin-left: 20px; color: #9c9c9c; margin-bottom: 15px; font-size: 15px;">访客开启会话框后,在设置的时间内,访客没有任何操作,系统将发出提示语并立即关闭对话。</p>
                             <label class="col-sm-3 control-label">超时时间:</label>
                             <div class="input-group col-sm-1">
                                 <input type="text" class="form-control" name="unoperated" required="" aria-required="true" value="{$systemconfig[1]['systemconfig_data']}">

+ 1 - 1
application/admin/view/users/adduser.html

@@ -134,7 +134,7 @@
             ,done: function(res){
                 //上传完毕回调
                 if(0 == res.code){
-                    $("#avatar").html('<img src="' + res.data.src + '" width="50px" height="50px">');
+                    $("#avatar").html('<img src="' + res.data.src + '" height="40px">');
                     $("#user_avatar").val(res.data.src);
                 }else{
                     layer.msg(res.msg);

+ 2 - 2
application/admin/view/users/edituser.html

@@ -31,7 +31,7 @@
                             </div>
                             <span>建议上传180px*180px</span>
                             <div class="input-group col-sm-3" id="avatar">
-                                <img src="{$info['user_avatar']}" width="40px" height="40px"/>
+                                <img src="{$info['user_avatar']}" height="40px"/>
                             </div>
                         </div>
                         <div class="form-group">
@@ -137,7 +137,7 @@
             ,done: function(res){
                 //上传完毕回调
                 if(0 == res.code){
-                    $("#avatar").html('<img src="' + res.data.src + '" width="50px" height="50px">');
+                    $("#avatar").html('<img src="' + res.data.src + '" height="40px">');
                     $("#user_avatar").val(res.data.src);
                 }else{
                     layer.msg(res.msg);

+ 2 - 2
application/admin/view/users/index.html

@@ -112,9 +112,9 @@
             url: "{:url('users/index')}", //获取数据的地址
             striped: true,  //表格显示条纹
             pagination: true, //启动分页
-            pageSize: 10,  //每页显示的记录数
+            pageSize: 50,  //每页显示的记录数
             pageNumber:1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",

+ 29 - 6
application/admin/view/words/index.html

@@ -31,11 +31,14 @@
         </div>
         <div class="ibox-content" style="border-top: 0;">
             <a href="/admin/words/addword.html">
-                <button class="btn btn-primary" type="button" style="margin-top:5px"><strong>新增常用语</strong>
+                <button class="btn btn-primary" type="button" style="margin-top:10px"><strong>新增常用语</strong>
                 </button>
             </a>
             <form action="/admin/words/inserExcel" enctype="multipart/form-data" method="post" role="form" class="form-inline pull-right">
-                <div class="content clearfix m-b" style="margin-left: 50px;">
+                <div class="content clearfix m-b">
+                    <div class="form-group">
+                        <a href="javascript:allDel()" class="btn" style="margin-top:5px;" ><button type="button" class="btn btn-danger btn-sm"><i class="fa fa-trash-o"></i>全部删除</button></a>
+                    </div>
                     <div class="form-group">
                         <a href="/static/admin/file/words.xlsx" class="btn btn-primary" style="margin-top:5px" >下载快捷回复模板文件</a>
                     </div>
@@ -51,9 +54,9 @@
             <!--搜索框开始-->
             <form id='commentForm' role="form" method="post" class="form-inline pull-right">
                 <input style="display: none">
-                <div class="content clearfix m-b">
+                <div class="content clearfix m-b"  style="margin-top:5px;">
                     <div class="form-group">
-                        <label>常用语内容:</label>
+                        <label>常用语:</label>
                         <input type="text" class="form-control" id="content" name="content">
                     </div>
                     <div class="form-group">
@@ -112,9 +115,9 @@
             url: "{:url('words/index')}", //获取数据的地址
             striped: true,  //表格显示条纹
             pagination: true, //启动分页
-            pageSize: 10,  //每页显示的记录数
+            pageSize: 50,  //每页显示的记录数
             pageNumber:1, //当前第几页
-            pageList: [5, 10, 15, 20, 25],  //记录数可选列表
+            pageList: [20, 50],  //记录数可选列表
             sidePagination: "server", //表示服务端请求
             paginationFirstText: "首页",
             paginationPreText: "上一页",
@@ -169,6 +172,26 @@
         })
 
     }
+
+    function allDel(){
+        layer.confirm('确认删除全部快捷回复?', {icon: 3, title:'提示'}, function(index){
+            //do something
+            $.getJSON("{:url('words/delAll')}", function(res){
+                if(1 == res.code){
+                    layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
+                        initTable();
+                    });
+                }else if(111 == res.code){
+                    window.location.reload();
+                }else{
+                    layer.alert(res.msg, {title: '友情提示', icon: 2});
+                }
+            });
+
+            layer.close(index);
+        })
+
+    }
 </script>
 </body>
 </html>

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

@@ -21,6 +21,7 @@
 //declare(ticks=1);
 use \GatewayWorker\Lib\Gateway;
 use Workerman\Lib\Timer;
+use Workerman\Worker;
 
 
 /**
@@ -124,6 +125,7 @@ class Events
         } else {
             self::DebugOut($message, "OnMessage");
         }
+        //echo(Gateway::getAllClientCount());
         $message = json_decode($message, true);
         if (isset($message['type'])) {
             switch ($message['type']) {
@@ -228,12 +230,12 @@ class Events
         if (substr($message['from_id'], 0, 2) === 'KF') {
             // 统计敏感词.
             $data['alarm_serverSensitive'] += $message['sensitiveNumber'];
-            $data['userLastTime'] = time();
+            $data['serverLastTime'] = time();
             Gateway::sendToClient($data['client_id'], json_encode($chat_message, 256));
         } else {
             // 统计敏感词.
             $data['alarm_userSensitive'] += $message['sensitiveNumber'];
-            $data['serverLastTime'] = time();
+            $data['userLastTime'] = time();
             Gateway::sendToClient($data['kf_client_id'], json_encode($chat_message, 256));
         }
         // 保存修改后的工单信息.
@@ -1194,7 +1196,7 @@ class Events
                     $chat_message = [
                         'message_type' => 'overtime',
                         'data' => [
-                            'content' => self::$global->unoperated['systemconfig_content'],
+                            'content' => $configUnoperated['systemconfig_content'],
                         ]
                     ];
                     Gateway::sendToClient($data['client_id'], json_encode($chat_message, 256));
@@ -1207,7 +1209,7 @@ class Events
                 $chat_message = [
                     'message_type' => 'overtime',
                     'data' => [
-                        'content' => self::$global->overtime['systemconfig_content'],
+                        'content' => $configOvertime['systemconfig_content'],
                     ]
                 ];
                 Gateway::sendToClient($data['client_id'], json_encode($chat_message, 256));