|
|
@@ -991,14 +991,23 @@ class Events
|
|
|
*/
|
|
|
private static function writeLog($flag = 1)
|
|
|
{
|
|
|
-
|
|
|
- return;
|
|
|
-
|
|
|
// 上午 8点 到 22 点开始统计
|
|
|
if (date('H') < 8 || date('H') > 22) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ $inQueue_1 = self::$redis->hget(self::USERLIST);
|
|
|
+ $inQueue = empty($inQueue_1) ? 0 : count($inQueue_1);
|
|
|
+ $allkf = self::$redis->hgetall(self::KFINFOKEY);
|
|
|
+ $nowTalking = $onlineKf = 0;
|
|
|
+ if (!empty($allkf)) {
|
|
|
+ foreach ($onlineKf as $kfuid => $val) {
|
|
|
+ $tmp = json_decode($val, true);
|
|
|
+ $onlineKf++;
|
|
|
+ $nowTalking += count($tmp['user_info']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
$key = date('Ymd') . 'total_in';
|
|
|
$key2 = date('Ymd') . 'success_in';
|
|
|
$param = [
|
|
|
@@ -1459,6 +1468,15 @@ class Events
|
|
|
});
|
|
|
|
|
|
|
|
|
+ // 1分钟统计一次实时数据
|
|
|
+ Timer::add(60 * 1, function () {
|
|
|
+ self::writeLog(1);
|
|
|
+ });
|
|
|
+ // 40分钟写一次当前日期点数的log数据
|
|
|
+ Timer::add(60 * 40, function () {
|
|
|
+ self::writeLog(2);
|
|
|
+ });
|
|
|
+
|
|
|
//初始化.....
|
|
|
self::upsystemconfig();
|
|
|
//每3分钟更新一次系统配置文件
|