|
|
@@ -24,6 +24,7 @@ class UserTimeout extends Command
|
|
|
|
|
|
public function execute(Input $input, Output $output)
|
|
|
{
|
|
|
+ $status = 0; //0:正常 1:异常
|
|
|
|
|
|
//检测离线用户状态
|
|
|
$this->checkOfflineUser();
|
|
|
@@ -35,7 +36,7 @@ class UserTimeout extends Command
|
|
|
if (isset($config['user_timeout_warning']) && $config['user_timeout_warning'] > 0) {
|
|
|
$user_timeout_warning = $config['user_timeout_warning'];
|
|
|
//用户等待即将超时预警
|
|
|
- $list = User::where('status', 1)->where('is_online', 1)->where('service_status', 1)
|
|
|
+ $list = User::where('status', $status)->where('is_online', 1)->where('service_status', 1)
|
|
|
->where('service_start', '<=', time() - $user_timeout_warning)
|
|
|
->where('timeout_type', 0)
|
|
|
->select()
|
|
|
@@ -47,7 +48,7 @@ class UserTimeout extends Command
|
|
|
if (isset($config['user_timeouted_warning']) && $config['user_timeouted_warning'] > 0) {
|
|
|
$user_timeouted_warning = $config['user_timeouted_warning'];
|
|
|
//用户等待已超时预警
|
|
|
- $list = User::where('status', 1)->where('is_online', 1)->where('service_status', 1)
|
|
|
+ $list = User::where('status', $status)->where('is_online', 1)->where('service_status', 1)
|
|
|
->where('service_start', '<=', time() - $user_timeouted_warning)
|
|
|
->where(function($query) use ($user_timeout_warning){
|
|
|
if ($user_timeout_warning > 0) {
|
|
|
@@ -65,7 +66,7 @@ class UserTimeout extends Command
|
|
|
if (isset($config['kefu_timeout_warning']) && $config['kefu_timeout_warning'] > 0) {
|
|
|
$kefu_timeout_warning = $config['kefu_timeout_warning'];
|
|
|
//用户服务中-即将超时预警时间
|
|
|
- $list = User::where('status', 1)->where('is_online', 1)->where('service_status', 2)
|
|
|
+ $list = User::where('status', $status)->where('is_online', 1)->where('service_status', 2)
|
|
|
->where('service_start', '<=', time() - $kefu_timeout_warning)
|
|
|
->where('timeout_type', '<',3)
|
|
|
->select()
|
|
|
@@ -77,7 +78,7 @@ class UserTimeout extends Command
|
|
|
if (isset($config['kefu_timeout_reminder']) && $config['kefu_timeout_reminder'] > 0) {
|
|
|
$timeout_reminder = $config['kefu_timeout_reminder'];
|
|
|
//用户服务中-已超时提醒
|
|
|
- $list = User::where('status', 1)->where('is_online', 1)->where('service_status', 2)
|
|
|
+ $list = User::where('status', $status)->where('is_online', 1)->where('service_status', 2)
|
|
|
->where('service_start', '<=', time() - $timeout_reminder)
|
|
|
->where(function($query) use ($kefu_timeout_warning){
|
|
|
if ($kefu_timeout_warning > 0) {
|