|
|
@@ -209,7 +209,6 @@ class Events
|
|
|
//echo "onMessage: " . $message . "\r\n";
|
|
|
// print_r([self::$global->kfList, self::$global->userList, self::$global->uidSimpleList, self::$global->userToKf, $_SESSION['remotip'] . '.' . $_SESSION['remotport']]);
|
|
|
}
|
|
|
-
|
|
|
$message = json_decode($message, true);
|
|
|
if (isset($message['type'])) {
|
|
|
switch ($message['type']) {
|
|
|
@@ -854,11 +853,13 @@ class Events
|
|
|
if ($serviceLog) {
|
|
|
$servicelog_id = $serviceLog[0]['servicelog_id'];
|
|
|
$logCount = self::$db->query("select count(*) as `count` from `ws_chat_log` where `servicelog_id`= '$servicelog_id'");
|
|
|
- $alarmCount = $logCount[0]['count'];
|
|
|
- $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'
|
|
|
+ if ($logCount) {
|
|
|
+ $alarmCount = $logCount[0]['count'];
|
|
|
+ $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'
|
|
|
where `servicelog_id`= '$servicelog_id'");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
Gateway::closeClient($val);
|
|
|
@@ -963,7 +964,7 @@ class Events
|
|
|
];
|
|
|
$now = time();
|
|
|
$kf__uid = substr($kfuid, 2);
|
|
|
- $sql = "update `ws_service_log` set `status` = '3',end_time=$now where `user_id`= '$uid' and kf_id='$kf__uid' and group_id=$kfgroup and status=1 ";
|
|
|
+ $sql = "update `ws_service_log` set `status` = '3' where `user_id`= '$uid' and kf_id='$kf__uid' and group_id=$kfgroup and status=1 ";
|
|
|
//echo "客户退出:". $sql ."\n";
|
|
|
self::$db->query($sql);
|
|
|
Gateway::sendToClient($krclient_id, json_encode($chat_message, 256));
|
|
|
@@ -991,8 +992,19 @@ class Events
|
|
|
'id' => $userId
|
|
|
]
|
|
|
];
|
|
|
- Gateway::sendToClient($kfList[$groupId]['KF' . $kf_id]['client_id'], json_encode($del_message, 256));
|
|
|
+ Gateway::sendToClient($kfList[$groupId][$kf_id]['client_id'], json_encode($del_message, 256));
|
|
|
unset($del_message);
|
|
|
+ $now = time();
|
|
|
+ $sql = "update `ws_service_log` set `status`='2',end_time=$now where `servicelog_id`= '$servicelog_id'";
|
|
|
+ self::$db->query($sql);
|
|
|
+ // 修改会话时长
|
|
|
+ $serviceLog = self::$db->query("select `start_time`,`intime` from `ws_service_log` 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'];
|
|
|
+ $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'
|
|
|
+ where `servicelog_id`= '$servicelog_id'");
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1879,13 +1891,13 @@ class Events
|
|
|
join `ws_users` on ws_service_log.kf_id=ws_users.id
|
|
|
WHERE ws_service_log.status='1' OR ws_service_log.status='3'");
|
|
|
// 查询系统设置表.
|
|
|
- $systemconfig = self::$db->query("SELECT `systemconfig_data` FROM `ws_systemconfig` WHERE `systemconfig_enName`='verifyReturnTime' or `systemconfig_enName`='verifyAllTime'");
|
|
|
- $found_key = array_search('verifyReturnTime', array_column($systemconfig, 'systemconfig_enName'));
|
|
|
+ $systemconfig = self::$db->query("SELECT `systemconfig_data`,`systemconfig_enName` FROM `ws_systemconfig` WHERE `systemconfig_enName`='verifyReturnTime' or `systemconfig_enName`='verifyAllTime'");
|
|
|
+ $returnTimeKey = array_search('verifyReturnTime', array_column($systemconfig, 'systemconfig_enName'));
|
|
|
// 质检会话响应时长.
|
|
|
- $verifyReturnTime = $systemconfig[$found_key]['systemconfig_data'];
|
|
|
- $found_key = array_search('verifyAllTime', array_column($systemconfig, 'systemconfig_enName'));
|
|
|
+ $verifyReturnTime = $systemconfig[$returnTimeKey]['systemconfig_data'];
|
|
|
+ $allTimeKey = array_search('verifyAllTime', array_column($systemconfig, 'systemconfig_enName'));
|
|
|
// 质检会话时长.
|
|
|
- $verifyAllTime = $systemconfig[$found_key]['systemconfig_data'];
|
|
|
+ $verifyAllTime = $systemconfig[$allTimeKey]['systemconfig_data'];
|
|
|
// 差评次数.
|
|
|
$evaluateCount = 0;
|
|
|
// 未结束工单id.
|
|
|
@@ -1924,7 +1936,9 @@ class Events
|
|
|
}
|
|
|
$serviceLog[$k]['allCount'] = $allCount;
|
|
|
}
|
|
|
+
|
|
|
print_r([$serviceLog, $csdTime, $verifyReturnTime]);
|
|
|
+
|
|
|
// 查询对话时效设置.
|
|
|
foreach ($adminList as $v) {
|
|
|
$chat_message = [
|