Browse Source

'实时数据报警监控错误bug修改'

Ethan 6 years ago
parent
commit
aa8940131c

+ 10 - 0
application/admin/controller/Login.php

@@ -10,6 +10,16 @@ use think\Controller;
 
 class Login extends Controller
 {
+    // 稳定性测试
+    /*public function aaaa()
+    {
+        $accounts = db('accounts')->select();
+        $this->assign([
+            'accounts' => json_encode($accounts),
+            'socket' => config('socket'),
+        ]);
+        return $this->fetch();
+    }*/
     // 登录首页
     public function index()
     {

+ 7 - 5
application/admin/controller/System.php

@@ -112,9 +112,13 @@ class System extends Base
                 $upRoundWhere['systemconfig_id']  = 5;
                 model('Systemconfig')->updateSystemconfig($upRoundWhere, $upRoundData);
                 // 客服接待人数设置.
-                $upKfConfigData['max_service']      = $param['max_service'];
-                $upKfConfigData['kfConfig_maxWait'] = $param['kfConfig_maxWait'];
-                db('kf_config')->where('id', 1)->update($upKfConfigData);
+                $upMSWhere['systemconfig_enName'] = 'KFMaxServices';
+                $upMSData['systemconfig_data']    = $param['max_service'];
+                model('Systemconfig')->updateSystemconfig($upMSWhere, $upMSData);
+                // 最大排队人数设置.
+                $upMWWhere['systemconfig_enName'] = 'maxWait';
+                $upMWData['systemconfig_data']    = $param['kfConfig_maxWait'];
+                model('Systemconfig')->updateSystemconfig($upMWWhere, $upMWData);
 
                 return json(['code' => 1, 'data' => '', 'msg' => '设置成功']);
             } catch (\Exception $e) {
@@ -124,11 +128,9 @@ class System extends Base
 
         // 获取设置.
         $systemconfig = model('Systemconfig')->selectSystemconfig();
-        $kfConfig     = db('kf_config')->where('id', 1)->find();
         $this->assign(
             [
                 'systemconfig' => $systemconfig,
-                'kfConfig'     => $kfConfig,
                 'status'       => config('kf_status'),
             ]
         );

+ 8 - 0
application/admin/view/index/index.html

@@ -371,6 +371,14 @@
                 break;
         }
     };
+
+    socket.onclose = function(res) {
+      layer.alert('实时监控断开', {
+        title: '友情提示', icon: 1, closeBtn: 0
+      }, function(){});
+    };
+
+
     /**
      * 时间戳转化为年 月 日 时 分 秒
      * time: 传入时间戳

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

@@ -100,14 +100,14 @@
                             <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" style="width: 45px">
-                                <input type="text" class="form-control" name="max_service" required="" aria-required="true" value="{$kfConfig['max_service']}">
+                                <input type="text" class="form-control" name="max_service" required="" aria-required="true" value="{$systemconfig[6]['systemconfig_data']}">
                             </div>
                             <label class="control-label" style="margin-left: 20px;">人</label>
                         </div>
                         <div class="form-group" style="flex-wrap: wrap; display: flex">
                             <label class="col-sm-3 control-label">最大排队人数设置:</label>
                             <div class="input-group col-sm-1" style="width: 45px">
-                                <input type="text" class="form-control" name="kfConfig_maxWait" required="" aria-required="true" value="{$kfConfig['kfConfig_maxWait']}">
+                                <input type="text" class="form-control" name="kfConfig_maxWait" required="" aria-required="true" value="{$systemconfig[7]['systemconfig_data']}">
                             </div>
                             <label class="control-label" style="margin-left: 20px;">人</label>
                         </div>

+ 11 - 1
vendor/GatewayWorker_windows/Applications/whisper/Events.php

@@ -988,7 +988,17 @@ class Events
 
         $userInfo['intime'] = date("H:i", $userInfo['intime']);  ///后改为只显示小时分
         $ut_tmp = self::getUserInfoCache($uid);
-        $userInfo = array_merge($userInfo, ['account_name' => $ut_tmp['account_name'], 'nick_name' => $ut_tmp['nick_name'], 'account_email' => $ut_tmp['account_email'], 'account_phone' => $ut_tmp['account_phone'], 'address' => $ut_tmp['address'], 'remark' => $ut_tmp['remark'], 'label' => self::$global->accountslabel[$ut_tmp['label_id']]['name']]);
+        $userInfo = array_merge($userInfo,
+            [
+                'account_name' => $ut_tmp['account_name'],
+                'nick_name' => $ut_tmp['nick_name'],
+                'account_email' => $ut_tmp['account_email'],
+                'account_phone' => $ut_tmp['account_phone'],
+                'address' => $ut_tmp['address'],
+                'remark' => $ut_tmp['remark'],
+                'label' => self::$global->accountslabel[$ut_tmp['label_id']]['name']
+            ]
+        );
         $noticeKf = [
             'message_type' => 'connect',
             'data' => [