فهرست منبع

'修改敏感词'

Ethan 6 سال پیش
والد
کامیت
a40ff6afab

+ 3 - 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' => '该敏感词已经存在']);
             }
 

+ 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'] = '客服关闭';

+ 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']}">

+ 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));