Browse Source

Merge branch 'master' of http://git.bocai108.com:10180/Ethan/Customer-Service

Jonlin 6 years ago
parent
commit
ec057b0b28
1 changed files with 8 additions and 4 deletions
  1. 8 4
      vendor/GatewayWorker_windows/Applications/whisper/Events.php

+ 8 - 4
vendor/GatewayWorker_windows/Applications/whisper/Events.php

@@ -41,8 +41,10 @@ class Events
     public static function onWorkerStart($worker)
     {
         if (empty(self::$db)) {
-            //self::$db = new \Workerman\MySQL\Connection('192.168.2.168', '3306', 'vali', '123456', 'customer_service');
-            self::$db = new \Workerman\MySQL\Connection('192.168.2.200', '3306', 'vali', '1234', 'customer_service');
+            $mds = DIRECTORY_SEPARATOR;
+            $dbcfg = realpath(dirname(__FILE__) . $mds . '..' . $mds . '..' . $mds . '..' . $mds . '..') . $mds . 'application' . $mds . 'database.php';
+            $conf = require($dbcfg);
+            self::$db = new \Workerman\MySQL\Connection($conf['hostname'], $conf['hostport'], $conf['username'], $conf['password'], $conf['database']);
         }
 
 
@@ -209,7 +211,7 @@ class Events
             return;
         } else {
             self::DebugOut($message, "OnMessage");
-            self::DebugOut([self::$global->kfList, self::$global->userList, self::$global->uidSimpleList, self::$global->userToKf, $_SESSION['remotip'] . ':' . $_SESSION['remotport']],'Msg mem: ');
+            self::DebugOut([self::$global->kfList, self::$global->userList, self::$global->uidSimpleList, self::$global->userToKf, $_SESSION['remotip'] . ':' . $_SESSION['remotport']], 'Msg mem: ');
         }
         $message = json_decode($message, true);
         if (isset($message['type'])) {
@@ -602,10 +604,12 @@ class Events
         unset($noticeUser);
 
         // 通知客服端绑定会员的信息
+        //$userinfodetail = self::getClientIndo($uid);
+        $userinfoarr = ['id' => $uid, 'name' => $oldlog['user_name'], 'avatar' => $oldlog['user_avatar'], 'website' => $oldlog['website'], 'browse' => $oldlog['browse'], 'system' => $oldlog['system'], 'ip' => $oldlog['user_ip'], 'group' => $oldlog['group_id'], 'client_id' => $oldlog['client_id']];
         $noticeKf = [
             'message_type' => 'connect',
             'data' => [
-                'user_info' => self::getClientIndo($uid),
+                'user_info' => $userinfoarr,
                 'conversationId' => $new_id,
             ]
         ];