lip 1 mês atrás
pai
commit
e3e9e133de

+ 3 - 2
app/admin/command/UserQueue.php

@@ -25,9 +25,10 @@ class UserQueue extends Command
 
     public function execute(Input $input, Output $output)
     {
+        $status = 0; //0:正常 1:异常
         $auto_cs_uid = getAutoCsUid();
         $where = [
-            ['status', '=', 1],
+            ['status', '=', $status],
             ['is_online', '=', 1],
             ['role', '=', 3],
             ['user_id', '<>', $auto_cs_uid],
@@ -36,7 +37,7 @@ class UserQueue extends Command
         while(true) {
 
             //排队用户
-            $list = User::where('status', 1)->where('is_online', 1)->where('service_status', 0)
+            $list = User::where('status', $status)->where('is_online', 1)->where('service_status', 0)
                         ->order('service_start', 'asc')
                         ->select()
                         ->toArray();

+ 5 - 4
app/admin/command/UserTimeout.php

@@ -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) {

+ 1 - 1
app/admin/controller/Kefu.php

@@ -325,7 +325,7 @@ class Kefu extends BaseController
                 ->join(env('database.DATABASE').'.bot_users user', 'admin.id = user.uid', 'left')
                 // ->join('user', 'admin.id = user.uid', 'left')
                 ->where('user.role', '>', 0)
-                ->where('user.status', 1)
+                ->where('user.status', 0)
                 // ->where('admin.department_id', $department_id)->whereOr(function ($query) use ($parent_department_id) {
                 //     if ($parent_department_id) {
                 //         $query->where('admin.department_id', $parent_department_id);