Просмотр исходного кода

Wesmiler OTC 提交更新 0729

APPLE 3 лет назад
Родитель
Сommit
b2aab6c062

+ 8 - 4
app/Console/Commands/Socket.php

@@ -106,7 +106,9 @@ class Socket extends Command
         $op = isset($data['op']) ? $data['op'] : '';
         $userId = isset($data['from_uid'])? intval($data['from_uid']) : 0;
         $chatKey = isset($data['chat_key'])? trim($data['chat_key']) : '';
+        $toUid = isset($data['to_uid'])? intval($data['to_uid']) : 0;
         if($userId && $frame->fd){
+            $chatKey = $chatKey? $chatKey : getChatKey($userId, $toUid);
             RedisService::set("chats:bind:{$userId}", ['fd'=> $frame->fd, 'user_id'=> $userId,'chat_key'=>$chatKey], 86400);
         }
         if ($data) {
@@ -115,7 +117,6 @@ class Socket extends Command
                     $toUid = isset($data['to_uid']) ? intval($data['to_uid']) : 0;
                     $fromUid = isset($data['from_uid']) ? intval($data['from_uid']) : 0;
                     $messageType = isset($data['message_type']) ? $data['message_type'] : 1;
-
                     if ($toUid <= 0 || $fromUid <= 0) {
                         return false;
                     }
@@ -127,6 +128,7 @@ class Socket extends Command
                     }
 
                     $toInfo = MemberService::make()->getInfo($toUid);
+                    var_dump($toInfo);
                     $fromInfo = MemberService::make()->getInfo($fromUid);
                     $message = isset($data['message']) ? $data['message'] : '';
                     $chatKey = getChatKey($fromUid, $toUid);
@@ -134,14 +136,16 @@ class Socket extends Command
                         'type' => isset($data['type']) ? $data['type'] : 1,
                         'message_type' => $messageType,
                         'from_uid' => $fromUid,
-                        'from_userName' => isset($fromInfo['username']) ? format_account($fromInfo['username']) : '客服',
+                        'from_username' => isset($fromInfo['username']) ? $fromInfo['username'] : '客服',
+                        'from_username_text' => isset($fromInfo['username']) ? format_account($fromInfo['username']) : '客服',
                         'to_uid' => isset($data['to_uid']) ? $data['to_uid'] : 0,
-                        'to_userName' => isset($toInfo['username']) ? format_account($toInfo['username']) : '客服',
+                        'to_username' => isset($toInfo['username']) ? $toInfo['username'] : '客服',
+                        'to_username_text' => isset($toInfo['username']) ? format_account($toInfo['username']) : '客服',
                         'chat_key' => $chatKey,
                         'message' => $message,
                         'message_url' => $messageType == 2 && $message ? get_image_url($message) : '',
                         'create_time' => time(),
-                        'time_text' => date('m-d H:i'),
+                        'time_text' => format_time(time()-1),
                         'is_read' => 1,
                         'status' => 1,
                     ];

+ 1 - 0
app/Services/Common/AdvertOrderService.php

@@ -125,6 +125,7 @@ class AdvertOrderService extends BaseService
                 $item['create_time_text'] = $item['create_time'] ? datetime($item['create_time'], 'Y-m-d H:i:s') : '';
                 $item['update_time_text'] = $item['update_time'] ? datetime($item['update_time'], 'Y-m-d H:i:s') : '';
                 $item['time_text'] = $item['create_time'] ? datetime($item['create_time'], 'H:i') : '';
+                $item['utime_text'] = $item['update_time'] ? datetime($item['update_time'], 'H:i') : '';
                 $item['pay_time_text'] = $item['pay_time'] ? datetime($item['pay_time'], 'Y-m-d H:i') : '';
                 $item['username_text'] = $item['username'] ? format_account($item['username']) : '';
                 $item['c_username_text'] = $item['c_username'] ? format_account($item['c_username']) : '';

+ 1 - 0
app/Services/Common/TradeOrderService.php

@@ -128,6 +128,7 @@ class TradeOrderService extends BaseService
                 $item['create_time_text'] = $item['create_time'] ? datetime($item['create_time'], 'Y-m-d H:i:s') : '';
                 $item['update_time_text'] = $item['update_time'] ? datetime($item['update_time'], 'Y-m-d H:i:s') : '';
                 $item['time_text'] = $item['create_time'] ? datetime($item['create_time'], 'H:i') : '';
+                $item['utime_text'] = $item['update_time'] ? datetime($item['update_time'], 'H:i') : '';
                 $item['pay_time_text'] = $item['pay_time'] ? datetime($item['pay_time'], 'Y-m-d H:i') : '';
                 $item['username_text'] = $item['username'] ? format_account($item['username']) : '';
                 $item['c_username_text'] = $item['c_username'] ? format_account($item['c_username']) : '';