xiaogang 4 년 전
부모
커밋
58c0834d25
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      app/Http/Controllers/Api/ChatController.php

+ 5 - 0
app/Http/Controllers/Api/ChatController.php

xqd
@@ -45,6 +45,11 @@ class ChatController extends Controller
                 'to_user_id'=>$toUser->id,
                 'atime'=>date('Y-m-d H:i:s'),
             ]);
+            ChatList::query()->firstOrCreate([
+                'user_id'=>$toUser->id,
+                'to_user_id'=>$user->id,
+                'atime'=>date('Y-m-d H:i:s'),
+            ]);
             DB::commit();
         }catch (\Exception $exception){
             DB::rollBack();