lip преди 3 месеца
родител
ревизия
09ecf9fd64
променени са 3 файла, в които са добавени 14 реда и са изтрити 0 реда
  1. 3 0
      app/admin/command/UserTimeout.php
  2. 8 0
      app/admin/controller/Kefu.php
  3. 3 0
      app/admin/model/User.php

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

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

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

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