Selaa lähdekoodia

结束延迟,最高一分钟。咨询订单socket加返回信息

lizhen_gitee 1 viikko sitten
vanhempi
commit
0b419e6eec
2 muutettua tiedostoa jossa 8 lisäystä ja 3 poistoa
  1. 6 2
      app/Http/Controllers/Api/ChatController.php
  2. 2 1
      app/Jobs/AskFinishJob.php

+ 6 - 2
app/Http/Controllers/Api/ChatController.php

@@ -351,11 +351,15 @@ class ChatController extends BaseController
             $websocket_id = GatewayUtils::uid2client_id($oid);
             if($websocket_id){
                 $mode = 5;
+                $socket_content = ['chat_content'=>_mini_emoji($chat_content, true), 'chat_image'=>$chat_image,
+                    'from_user'=>UserUtils::get_cached_user($uid) ];
+
                 if($ask_order_id){
                     $mode = 55;
+                    $socket_content['ask_order_id'] = $ask_order_id;
                 }
-                GatewayUtils::success($websocket_id, $mode, ['chat_content'=>_mini_emoji($chat_content, true), 'chat_image'=>$chat_image,
-                    'from_user'=>UserUtils::get_cached_user($uid) ]);
+
+                GatewayUtils::success($websocket_id, $mode, $socket_content);
             }
 
             $model->type = 'user';

+ 2 - 1
app/Jobs/AskFinishJob.php

@@ -36,7 +36,8 @@ class AskFinishJob implements ShouldQueue
         //已支付状态,且倒计时时间已经到了。给修改为结束
         $where = [
             ['status','=',15],
-            ['countdown_time','<',time() - 120],  //延迟2分钟
+//            ['countdown_time','<',time() - 120],  //延迟2分钟
+            ['countdown_time','<=',time()],  //计划任务一分钟一次,所以这里不延迟了
         ];
 
         $update = [