lip 3 tháng trước cách đây
mục cha
commit
09ecf9fd64

+ 3 - 0
app/admin/command/UserTimeout.php

@@ -105,6 +105,9 @@ class UserTimeout extends Command
 
                     Db::commit();
                     
+                    //通知关闭聊天框
+                    wsSendMsg($user['cs_uid'],'closeChat',['user_id'=>$user['user_id']]);
+
                     //通知客服已结束
                     wsSendMsg($user['cs_uid'],'handleChat',['user_id'=>$user['user_id']]);
                 } catch (\Exception $e) {

+ 8 - 0
app/admin/controller/Kefu.php

@@ -261,6 +261,10 @@ class Kefu extends BaseController
             }
 
             Db::commit();
+
+            //通知关闭聊天框
+            wsSendMsg($old_cs_uid,'closeChat',['user_id'=>$user_id]);
+
             //通知客服已接线
             wsSendMsg(0,'handleChat',['user_id'=>$user_id]);
         } catch (\Exception $e) {
@@ -334,6 +338,10 @@ class Kefu extends BaseController
                 }
 
                 Db::commit();
+
+                //通知关闭聊天框
+                wsSendMsg($old_cs_uid,'closeChat',['user_id'=>$user_id]);
+
                 //通知客服已结束
                 wsSendMsg(0,'handleChat',['user_id'=>$user_id]);
     

+ 3 - 0
app/admin/model/User.php

@@ -103,6 +103,9 @@ class User extends BaseModel
                 Message::where(['from_user' => $user_id, 'to_user' => $old_cs_uid])->update(['to_user' => $cs_uid, 'chat_identify' => $chat_identify, 'is_read' => 1]);
                 Message::where(['from_user' => $old_cs_uid, 'to_user' => $user_id])->update(['from_user' => $cs_uid, 'chat_identify' => $chat_identify, 'is_read' => 1]);
             }
+
+            //通知关闭聊天框
+            wsSendMsg($old_cs_uid,'closeChat',['user_id'=>$user_id]);
         }
         //结束客服忙碌时间
         KefuTime::endData($admin_id, 1);