Browse Source

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

Jonlin 6 năm trước cách đây
mục cha
commit
97444a6a19

+ 7 - 7
application/admin/controller/Report.php

@@ -152,13 +152,13 @@ class Report extends Base
             'allChat' => $allChat,
             'allService' => $allService,
             'allQueue' => $allQueue,
-            'transfer' => floor($transfer / 2),
-            'reply' => sprintf("%.2f", (($reply / ($allChatLog - $reply)) * 100)),
-            'waitTime' => ceil($alllWaitTime / $allService),
-            'serviceTime' => ceil($serviceTime / $allService),
-            'cpdTime' => ceil($cpdTime / $allService),
-            'evaluateGood' => sprintf("%.2f", (($evaluateGood / ($evaluateGood + $evaluateSecondary + $evaluateBad)) * 100)),
-            'evaluateGet' => sprintf("%.2f", ((($evaluateGood + $evaluateSecondary + $evaluateBad) / ($evaluateNo + $evaluateGood + $evaluateSecondary + $evaluateBad)) * 100)),
+            'transfer' => floor($transfer/2),
+            'reply' => ($allChatLog?sprintf("%.2f",(($reply/($allChatLog-$reply))*100)) : '--'),
+            'waitTime' => ($allService?ceil($alllWaitTime/$allService) : '--'),
+            'serviceTime' => ($allService?ceil($serviceTime/$allService) : '--'),
+            'cpdTime' => ($allService?ceil($cpdTime/$allService) : '--'),
+            'evaluateGood' => (($evaluateGood+$evaluateSecondary+$evaluateBad)?sprintf("%.2f",(($evaluateGood/($evaluateGood+$evaluateSecondary+$evaluateBad))*100)) : '--'),
+            'evaluateGet' => (($evaluateNo+$evaluateGood+$evaluateSecondary+$evaluateBad)?sprintf("%.2f",((($evaluateGood+$evaluateSecondary+$evaluateBad)/($evaluateNo+$evaluateGood+$evaluateSecondary+$evaluateBad))*100)) : '--'),
             'evaluate' => json_encode([
                 'evaluateGood' => $evaluateGood,
                 'evaluateSecondary' => $evaluateSecondary,

+ 27 - 0
application/admin/controller/System.php

@@ -310,6 +310,14 @@ class System extends Base
         return $this->fetch('wordslog');
     }
 
+    function matching($str, $a, $b)
+    {
+        $pattern = '/('.$a.')(.*)(?)('.$b.')/'; //正则规则匹配支付串中任何一个位置字符串
+        //$pattern = '/(#\[)(.*)(?)(\]\/)/';
+        preg_match_all($pattern,$str,$m);
+        //preg_match_all($pattern, $str, $m);   //返回一个匹配结果
+        print_r($m);die;  //到时候在这里书写返回值就好了 .die;
+    }
 
     // 历史会话记录详情
     public function detail($id)
@@ -326,6 +334,12 @@ class System extends Base
                 $content['content'] = '<img width="100%" src="'.$content['img'].'"/>';
             }
             if(!empty(strstr($chat[$i]['to_id'], 'KF'))){
+                /*$preg1 = "/^#[*]$/";
+                $preg= '/xue[\s\S]*?om/i';
+                preg_match_all($preg1,"#[哈哈]/",$res);
+                var_dump($res);*/
+                $this->matching("#[哈哈]/","#\[","\]\/");
+                //$this->getFacesIcon();
                 $html = $html . '<div style="margin-top:15px;width: 30%;"><div>'.$chat[$i]['from_name'].'&nbsp&nbsp&nbsp'.$chat[$i]['time_line'].'</div>';
                 $html = $html . '<p style="margin-top:5px;" class="form-content">'.$content['content'].'</p></div>';
             }else{
@@ -387,4 +401,17 @@ class System extends Base
 
         return $operate;
     }
+
+    public function getFacesIcon($facesIcon) {
+        $data = ["[微笑]", "[嘻嘻]", "[哈哈]", "[可爱]", "[可怜]", "[挖鼻]", "[吃惊]", "[害羞]", "[挤眼]", "[闭嘴]", "[鄙视]",
+            "[爱你]", "[泪]", "[偷笑]", "[亲亲]", "[生病]", "[太开心]", "[白眼]", "[右哼哼]", "[左哼哼]", "[嘘]", "[衰]",
+            "[委屈]", "[吐]", "[哈欠]", "[抱抱]", "[怒]", "[疑问]", "[馋嘴]", "[拜拜]", "[思考]", "[汗]", "[困]", "[睡]",
+            "[钱]", "[失望]", "[酷]", "[色]", "[哼]", "[鼓掌]", "[晕]", "[悲伤]", "[抓狂]", "[黑线]", "[阴险]", "[怒骂]",
+            "[互粉]", "[心]", "[伤心]", "[猪头]", "[熊猫]", "[兔子]", "[ok]", "[耶]", "[good]", "[NO]", "[赞]", "[来]",
+            "[弱]", "[草泥马]", "[神马]", "[囧]", "[浮云]", "[给力]", "[围观]", "[威武]", "[奥特曼]", "[礼物]", "[钟]",
+            "[话筒]", "[蜡烛]", "[蛋糕]"];
+        $key = array_search($facesIcon, $data);
+        return $key;
+    }
+
 }

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

@@ -121,10 +121,10 @@
                     src="{:url('Index/indexPage')}" frameborder="0"
                     data-id="index_v1.html" seamless></iframe>
         </div>
-        <div class="footer">
-            <!--<div class="pull-right">&copy; 2018-2020 {$version} <a href="http://baiyf.com" target="_blank">baiyf.com</a>
-            </div>-->
-        </div>
+        <!--<div class="footer">
+            <div class="pull-right">&copy; 2018-2020 {$version} <a href="http://baiyf.com" target="_blank">baiyf.com</a>
+            </div>
+        </div>-->
     </div>
     <!--右侧部分结束-->
     <!--右侧边栏开始-->

+ 98 - 80
application/admin/view/report/index.html

@@ -18,98 +18,116 @@
     </div>
 
     <div class="row">
-        <div>
-        <div class="col-sm-2">
-            <div class="ibox float-e-margins">
-                <div class="ibox-title" style="display: flex; justify-content: center;">
-                    <!--<span class="label label-primary pull-right">今天</span>-->
-                    <h3>总会话量</h3>
-                </div>
-                <div class="ibox-content" style="text-align: center">
-                    <h1 class="no-margins"><span>{$allChat}</span></h1>
-                    <small></small>
-                </div>
-                <div class="ibox-content" style="font-size: 12px; padding: 5px 20px 5px; height: 45px; line-height: 3;">
-                    <div style="justify-content: center; display: flex">
-                        <div style="text-align: right;">转接量</div>
-                        <div style="margin-left: 20px; text-align: right;">{$transfer}</div>
+        <div style="display: flex; justify-content: end;">
+        <!--搜索框开始-->
+            <form id='commentForm' role="form" method="post" class="form-inline pull-right" style="margin-right: 30px;">
+                <div class="content clearfix m-b">
+                    <div class="form-group">
+                        <label>时间区间:</label>
+                        <div class="layui-input-inline">
+                            <input style="width: 180px;" type="text" class="layui-input" name="daterang" id="daterang" value={$defaultTime} placeholder="时间段"
+                                   readonly="">
+                        </div>
+                    </div>
+                    <div class="form-group">
+                        <button class="btn btn-primary" type="button" id="search"><strong>搜 索</strong>
+                        </button>
                     </div>
                 </div>
-            </div>
+            </form>
         </div>
-        <div class="col-sm-2">
-            <div class="ibox float-e-margins">
-                <div class="ibox-title" style="display: flex; justify-content: center;">
-                    <!--<span class="label label-primary pull-right">今天</span>-->
-                    <h3>总消息量</h3>
-                </div>
-                <div class="ibox-content" style="text-align: center">
-                    <h1 class="no-margins"><span>{$allService}</span></h1>
-                    <small></small>
-                </div>
-                <div class="ibox-content" style="font-size: 12px; padding: 5px 20px 5px; height: 45px; line-height: 3;">
-                    <div style="justify-content: center; display: flex">
-                        <div style="text-align: right;">问答比</div>
-                        <div style="margin-left: 20px; text-align: right;">{$reply}%</div>
+        <div>
+            <div class="col-sm-2">
+                <div class="ibox float-e-margins">
+                    <div class="ibox-title" style="display: flex; justify-content: center;">
+                        <!--<span class="label label-primary pull-right">今天</span>-->
+                        <h3>总会话量</h3>
+                    </div>
+                    <div class="ibox-content" style="text-align: center">
+                        <h1 class="no-margins"><span>{$allChat}</span></h1>
+                        <small></small>
+                    </div>
+                    <div class="ibox-content" style="font-size: 12px; padding: 5px 20px 5px; height: 45px; line-height: 3;">
+                        <div style="justify-content: center; display: flex">
+                            <div style="text-align: right;">转接量</div>
+                            <div style="margin-left: 20px; text-align: right;">{$transfer}</div>
+                        </div>
                     </div>
                 </div>
             </div>
-        </div>
-        <div class="col-sm-2">
-            <div class="ibox float-e-margins">
-                <div class="ibox-title" style="display: flex; justify-content: center;">
-                    <!--<span class="label label-primary pull-right">今天</span>-->
-                    <h3>排队量</h3>
-                </div>
-                <div class="ibox-content" style="text-align: center">
-                    <h1 class="no-margins"><span>{$allQueue}</span></h1>
-                    <small></small>
-                </div>
-                <div class="ibox-content" style="font-size: 12px; padding: 5px 20px 5px; height: 45px; line-height: 3;">
-                    <div style="justify-content: center; display: flex">
-                        <div style="text-align: right;">平均排队时长</div>
-                        <div style="margin-left: 20px; text-align: right;">{$waitTime}</div>
+            <div class="col-sm-2">
+                <div class="ibox float-e-margins">
+                    <div class="ibox-title" style="display: flex; justify-content: center;">
+                        <!--<span class="label label-primary pull-right">今天</span>-->
+                        <h3>总消息量</h3>
+                    </div>
+                    <div class="ibox-content" style="text-align: center">
+                        <h1 class="no-margins"><span>{$allService}</span></h1>
+                        <small></small>
+                    </div>
+                    <div class="ibox-content" style="font-size: 12px; padding: 5px 20px 5px; height: 45px; line-height: 3;">
+                        <div style="justify-content: center; display: flex">
+                            <div style="text-align: right;">问答比</div>
+                            <div style="margin-left: 20px; text-align: right;">{$reply}%</div>
+                        </div>
                     </div>
                 </div>
             </div>
-        </div>
-        <div class="col-sm-2">
-            <div class="ibox float-e-margins">
-                <div class="ibox-title" style="display: flex; justify-content: center;">
-                    <!--<span class="label label-primary pull-right">今天</span>-->
-                    <h3>平均会话时长</h3>
-                </div>
-                <div class="ibox-content" style="text-align: center">
-                    <h1 class="no-margins"><span>{$serviceTime}</span><span style="font-size: 14px; margin-left: 10px">秒</span></h1>
-                    <small></small>
-                </div>
-                <div class="ibox-content" style="font-size: 12px; padding: 5px 20px 5px; height: 45px; line-height: 3;">
-                    <div style="justify-content: center; display: flex">
-                        <div style="text-align: right;">平均相应时长</div>
-                        <div style="margin-left: 20px; text-align: right;">{$cpdTime}</div>
+            <div class="col-sm-2">
+                <div class="ibox float-e-margins">
+                    <div class="ibox-title" style="display: flex; justify-content: center;">
+                        <!--<span class="label label-primary pull-right">今天</span>-->
+                        <h3>排队量</h3>
+                    </div>
+                    <div class="ibox-content" style="text-align: center">
+                        <h1 class="no-margins"><span>{$allQueue}</span></h1>
+                        <small></small>
+                    </div>
+                    <div class="ibox-content" style="font-size: 12px; padding: 5px 20px 5px; height: 45px; line-height: 3;">
+                        <div style="justify-content: center; display: flex">
+                            <div style="text-align: right;">平均排队时长</div>
+                            <div style="margin-left: 20px; text-align: right;">{$waitTime}</div>
+                        </div>
                     </div>
                 </div>
             </div>
-        </div>
-        <div class="col-sm-2">
-            <div class="ibox float-e-margins">
-                <div class="ibox-title" style="display: flex; justify-content: center;">
-                    <!--<span class="label label-primary pull-right">今天</span>-->
-                    <h3>相对满意度</h3>
-                </div>
-                <div class="ibox-content" style="text-align: center">
-                    <h1 class="no-margins"><span>{$evaluateGood}<span style="font-size: 14px; margin-left: 10px">%</span></span></h1>
-                    <small></small>
+            <div class="col-sm-2">
+                <div class="ibox float-e-margins">
+                    <div class="ibox-title" style="display: flex; justify-content: center;">
+                        <!--<span class="label label-primary pull-right">今天</span>-->
+                        <h3>平均会话时长</h3>
+                    </div>
+                    <div class="ibox-content" style="text-align: center">
+                        <h1 class="no-margins"><span>{$serviceTime}</span><span style="font-size: 14px; margin-left: 10px">秒</span></h1>
+                        <small></small>
+                    </div>
+                    <div class="ibox-content" style="font-size: 12px; padding: 5px 20px 5px; height: 45px; line-height: 3;">
+                        <div style="justify-content: center; display: flex">
+                            <div style="text-align: right;">平均响应时长</div>
+                            <div style="margin-left: 20px; text-align: right;">{$cpdTime}</div>
+                        </div>
+                    </div>
                 </div>
-                <div class="ibox-content" style="font-size: 12px; padding: 5px 20px 5px; height: 45px; line-height: 3;">
-                    <div style="justify-content: center; display: flex">
-                        <div style="text-align: right;">参评率</div>
-                        <div style="margin-left: 20px; text-align: right;">{$evaluateGet}%</div>
+            </div>
+            <div class="col-sm-2">
+                <div class="ibox float-e-margins">
+                    <div class="ibox-title" style="display: flex; justify-content: center;">
+                        <!--<span class="label label-primary pull-right">今天</span>-->
+                        <h3>相对满意度</h3>
+                    </div>
+                    <div class="ibox-content" style="text-align: center">
+                        <h1 class="no-margins"><span>{$evaluateGood}<span style="font-size: 14px; margin-left: 10px">%</span></span></h1>
+                        <small></small>
+                    </div>
+                    <div class="ibox-content" style="font-size: 12px; padding: 5px 20px 5px; height: 45px; line-height: 3;">
+                        <div style="justify-content: center; display: flex">
+                            <div style="text-align: right;">参评率</div>
+                            <div style="margin-left: 20px; text-align: right;">{$evaluateGet}%</div>
+                        </div>
                     </div>
                 </div>
             </div>
         </div>
-        </div>
         <div class="col-sm-12">
             <div class="ibox float-e-margins">
                 <div class="ibox-title">
@@ -117,7 +135,7 @@
                 </div>
                 <div class="ibox-content">
                     <!--搜索框开始-->
-                    <form id='commentForm' role="form" method="post" class="form-inline pull-right">
+                    <!--<form id='commentForm' role="form" method="post" class="form-inline pull-right">
                         <div class="content clearfix m-b">
                             <div class="form-group">
                                 <label>时间区间:</label>
@@ -131,8 +149,8 @@
                                 </button>
                             </div>
                         </div>
-                    </form>
-                    <div class="ibox-content" style="height: 350px" id="bar">
+                    </form>-->
+                    <div style="height: 350px" id="bar">
 
                     </div>
                 </div>
@@ -161,7 +179,7 @@
                         <div class="ibox-title">
                             <h5>访问来源</h5>
                         </div>
-                        <div id="system_data" style="text-align: center; width: 100%; font-size: 16px; background: #fff; height: 350px; border-top: 1px solid #e7eaec;">
+                        <div id="system_data" style="text-align: center; width: 100%; font-size: 16px; background: #fff; height: 350px;">
                             <div class="ibox-content" style="height: 350px" id="pie_system">
 
                             </div>
@@ -443,7 +461,7 @@
         };
         pie_system.setOption(option_PS);
     } else {
-        let pie_system_html = "<div style='line-height: 20;'>暂无数据</div>";
+        let pie_system_html = "<div style='line-height: 20; border-top: 1px solid #e7eaec;'>暂无数据</div>";
         $("#system_data").html(pie_system_html);
     }
 

+ 2 - 2
application/index/controller/Index.php

@@ -51,10 +51,10 @@ class Index extends Common
     }//end sensitiveWords()
 
 
-    public function index()
+    /*public function index()
     {
         return $this->fetch();
-    }
+    }*/
 
     // pc客户端
     public function chat()

+ 41 - 0
application/service/controller/History.php

@@ -41,6 +41,7 @@ class History extends Common
                 'browse',
                 'a.status',
                 'evaluate_id',
+                'intime',
                 'servicelog_id',
             ];
             // 关联信息.
@@ -133,12 +134,52 @@ class History extends Common
             // 获取用户信息.
             $chatLog      = model('ChatLog')->selectChatLog($chatLogField, $offset, $pageSize, $chatLogWhere);
             $countChatLog = model('ChatLog')->countChatLog($chatLogWhere);
+            // 查询报警信息.
+            $alarmField                    = [
+                'evaluate_id',
+                'alarm_corresponding',
+                'alarm_cvtOvertime',
+                'alarm_userSensitive',
+                'alarm_serverSensitive',
+                'alarm_respond',
+            ];
+            $alarmWhere['b.servicelog_id'] = $servicelogId;
+            $serviceLogJoin['service_log b'] = 'a.servicelog_id = b.servicelog_id';
+            $alarm = model('Alarm')->findAlarm($alarmField, $alarmWhere, $serviceLogJoin);
+            // 查询系统设置.
+            $systemconfig = model('Systemconfig')->selectSystemconfig($alarmField, $alarmWhere, $serviceLogJoin);
+            // 响应超时.
+            $verifyReturnTime = 0;
+            // 会话超时.
+            $cvtOvertime = 0;
+            foreach ($systemconfig as $v) {
+                if ($v['systemconfig_enName'] === 'verifyReturnTime') {
+                    if ($v['systemconfig_data'] < $alarm['alarm_corresponding']) {
+                        $verifyReturnTime = 1;
+                    }
+                }
+
+                if ($v['systemconfig_enName'] === 'verifyAllTime') {
+                    if ($v['systemconfig_data'] < $alarm['alarm_cvtOvertime']) {
+                        $cvtOvertime = 1;
+                    }
+                }
+            }
+
 
             $result['total']       = $countChatLog;
             $result['countPage']   = (ceil(($result['total']) / $pageSize));
             $result['currentPage'] = $currentPage;
             $result['list']        = $chatLog;
             $result['pageSize']    = $pageSize;
+            $result['alarm']       = [
+                'evaluate_id'      => $alarm['evaluate_id'],
+                'verifyReturnTime' => $verifyReturnTime,
+                'cvtOvertime'      => $cvtOvertime,
+                'serverSensitive'  => $alarm['alarm_serverSensitive'] ? 1 : 2,
+                'userSensitive'    => $alarm['alarm_userSensitive'] ? 1 : 2,
+                'respond'          => $alarm['alarm_respond'],
+            ];
 
             return json(['code' => 1, 'data' => $result, 'msg' => '成功']);
         } catch (\Exception $e) {

+ 2 - 2
application/service/controller/Index.php

@@ -94,7 +94,7 @@ class Index extends Common
     }//end userWords()
 
 
-    public function index()
+    /*public function index()
     {
         $getUserInfo = $this->getUserInfo();
 
@@ -109,7 +109,7 @@ class Index extends Common
         ]);
 
         return $this->fetch();
-    }
+    }*/
 
 
     // 获取服务用户列表

+ 42 - 0
application/service/model/Alarm.php

@@ -0,0 +1,42 @@
+<?php
+namespace app\service\model;
+
+use think\Model;
+
+/**
+ * 报警模型
+ */
+class Alarm extends Model
+{
+
+
+    /**
+     * 单数据筛选
+     *
+     * @access public
+     * @param mixed $field 字段
+     * @param mixed $where 条件
+     * @param mixed $join 关联
+     * @return array 返回类型
+     */
+    public function findAlarm($field, $where=[], $join=[])
+    {
+        $result = $this->field($field);
+        if (empty($join) === false) {
+            $result = $result->alias('a');
+            foreach ($join as $k => $v) {
+                $result = $result->join($k, $v);
+            }
+        }
+
+        if (empty($where) === false) {
+            $result = $result->where($where);
+        }
+
+        $result = $result->find();
+        return $result;
+
+    }//end findAlarm()
+
+
+}//end class

+ 27 - 0
application/service/model/Systemconfig.php

@@ -0,0 +1,27 @@
+<?php
+namespace app\service\model;
+
+use think\Model;
+
+/**
+ * 设置模型
+ */
+class Systemconfig extends Model
+{
+
+
+    /**
+     * 数据获取
+     *
+     * @access public
+     * @return array 返回类型
+     */
+    public function selectSystemconfig()
+    {
+        $result = $this->field(['systemconfig_enName', 'systemconfig_data'])->select();
+        return $result;
+
+    }//end selectSystemconfig()
+
+
+}//end class

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
public/static/admin/css/style.min.css


+ 2 - 2
public/static/service/js/functions.js

@@ -10,7 +10,7 @@ function replaceContent(content) {
 
         .replace(/face\[([^\s\[\]]+?)\]/g, function (face) {  // 转义表情
             var alt = face.replace(/^face/g, '');
-            return '<img alt="' + alt + '" title="' + alt + '" src="' + faces[alt] + '">';
+            return '<img alt="' + alt + '" title="' + alt + '" src="' + faces[alt] + '">';a
         })
         .replace(/img\[([^\s]+?)\]/g, function (img) {  // 转义图片
             return '<img class="layui-whisper-photos" src="' + img.replace(/(^img\[)|(\]$)/g, '') + '" width="100px" height="100px">';
@@ -50,4 +50,4 @@ function getFacesIcon() {
         "[互粉]", "[心]", "[伤心]", "[猪头]", "[熊猫]", "[兔子]", "[ok]", "[耶]", "[good]", "[NO]", "[赞]", "[来]",
         "[弱]", "[草泥马]", "[神马]", "[囧]", "[浮云]", "[给力]", "[围观]", "[威武]", "[奥特曼]", "[礼物]", "[钟]",
         "[话筒]", "[蜡烛]", "[蛋糕]"]
-}
+}

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

@@ -106,7 +106,7 @@ class Events
             });
 
             // 检查对话时效给出.
-            Timer::add(6, function () {
+            Timer::add(60, function () {
                 self::overTime();
             });
 
@@ -395,7 +395,9 @@ class Events
                     $client = Gateway::getClientIdByUid($userId);
                     if (!empty($client)) {
                         $clientId = $client['0'];
-                        self::serverClose($clientId, $message['data']['conversationId']);
+                        $servicelog_id = $message['data']['conversationId'];
+                        self::$db->query("update `ws_service_log` set `servicelog_close_type` = 3 where `servicelog_id`= '$servicelog_id'");
+                        self::serverClose($clientId, $servicelog_id);
                     }
                     break;
                 // 客服更改状态.
@@ -415,6 +417,8 @@ class Events
 
                     break;
                 case 'changeOtherhKeFu';
+                    $servicelog_id = $message['data']['conversationId'];
+                    self::$db->query("update `ws_service_log` set `servicelog_close_type` = 5 where `servicelog_id`= '$servicelog_id'");
                     self::changeOtherhKeFu($client_id, $message);
                     break;
                 // 弹出评价.
@@ -840,9 +844,10 @@ class Events
 
                     // 修改会话时长
                     $serviceLog = self::$db->query("select `start_time`,`servicelog_id`,`intime` from `ws_service_log` where `user_id`= '$simpliUsersID_UID_Arr[$val]' and  kf_id='$uid' and  group_id=$group  and  `status`!=2");
+                    $servicelog_id = $serviceLog[0]['servicelog_id'];
+                    self::$db->query("update `ws_service_log` set `servicelog_close_type` = 4 where `servicelog_id`= '$servicelog_id'");
                     $logCount = self::$db->query("select count(*) as `count` from `ws_chat_log` where `servicelog_id`= '$servicelog_id'");
                     $alarmCount = $logCount[0]['count'];
-                    $servicelog_id = $serviceLog[0]['servicelog_id'];
                     $cvtOvertime = time() - $serviceLog[0]['start_time'];
                     $alarmLineTime = $serviceLog[0]['start_time'] - $serviceLog[0]['intime'];
                     self::$db->query("update `ws_alarm` set `alarm_cvtOvertime` = '$cvtOvertime',`alarm_lineTime` = '$alarmLineTime',`alarm_count` = '$alarmCount'
@@ -1727,11 +1732,14 @@ class Events
         $setUnoperated = strtotime('-' . (self::$global->unoperated['systemconfig_data'] - 60) . ' second');
         $unoperated = strtotime('-' . (self::$global->unoperated['systemconfig_data']) . ' second');
         $noResponse = strtotime('-' . (self::$global->noResponse['systemconfig_data']) . ' second');
+        // 访客静默超时.
         foreach ($serviceLog as $k => $v) {
             if (!strlen(array_search($v['servicelog_id'], array_column($chatLog, 'servicelog_id')))) {
                 // 如果小于设定时间则关闭会话.
                 if ($v['start_time'] <= $unoperated) {
-                    self::serverClose($v['client_id'], $v['servicelog_id']);
+                    $servicelog_id = $v['servicelog_id'];
+                    self::$db->query("update `ws_service_log` set `servicelog_close_type` = 1 where `servicelog_id`= '$servicelog_id'");
+                    self::serverClose($v['client_id'], $servicelog_id);
                     // 如果小于设定时间前一分钟则给出提示.
                 } elseif ($v['start_time'] <= $setUnoperated) {
                     $chat_message = [
@@ -1744,13 +1752,15 @@ class Events
                 }
             }
         }
-        // 循环检测会话时效.
+        // 循环检测会话时效,会话超时关闭.
         foreach ($chatLog as $k => $v) {
             $toWho = substr($v['to_id'], 0, 2);
             // 如果对话为客服的最后一次对话且时间小于设定时间则结束工单.
             if ($v['time_line'] <= $overtime) {
                 $found_key = array_search($v['servicelog_id'], array_column($serviceLog, 'servicelog_id'));
-                self::serverClose($serviceLog[$found_key]['client_id'], $v['servicelog_id']);
+                $servicelog_id = $v['servicelog_id'];
+                self::$db->query("update `ws_service_log` set `servicelog_close_type` = 2 where `servicelog_id`= '$servicelog_id'");
+                self::serverClose($serviceLog[$found_key]['client_id'], $servicelog_id);
                 // 如果对话为客服的最后一次对话且时间小于设定时间前一分钟则给出提示.
             } elseif ($v['time_line'] <= $setOvertime) {
                 $chat_message = [

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác