Browse Source

增加类型

rkljw 10 hours ago
parent
commit
1c54eb522a
2 changed files with 15 additions and 1 deletions
  1. 2 1
      app/JsonRpc/ChatService.php
  2. 13 0
      runtime/logs/hyperf-2025-07-17.log

+ 2 - 1
app/JsonRpc/ChatService.php

@@ -953,7 +953,8 @@ class ChatService implements ChatServiceInterface
     {
         $result = ChatTopic::where(['chat_topics.id' => $data['id']])
             ->leftJoin('user', 'user.id', '=', 'chat_topics.user_id')
-            ->select('chat_topics.*', 'user.nickname', 'user.avatar', 'user.user_name')
+            ->leftJoin('chat_topic_class', 'chat_topic_class.id', '=', 'chat_topics.type')
+            ->select('chat_topics.*', 'user.nickname', 'user.avatar', 'user.user_name','chat_topic_class.topicname')
             ->first();
         return Result::success($result);
     }

+ 13 - 0
runtime/logs/hyperf-2025-07-17.log

@@ -0,0 +1,13 @@
+[2025-07-17 06:42:37] sql.INFO: [14.99] select count(*) as aggregate from `chat_groups_members` inner join `chat_topics` on `chat_topics`.`group_id` = `chat_groups_members`.`group_id` left join `chat_topic_class` on `chat_topic_class`.`id` = `chat_topics`.`type` where (`chat_groups_members`.`user_id` = '214') [] []
+[2025-07-17 06:42:37] sql.INFO: [4.47] select `chat_topics`.*, `chat_topic_class`.`topicname` from `chat_groups_members` inner join `chat_topics` on `chat_topics`.`group_id` = `chat_groups_members`.`group_id` left join `chat_topic_class` on `chat_topic_class`.`id` = `chat_topics`.`type` where (`chat_groups_members`.`user_id` = '214') order by `chat_topics`.`created_at` desc limit 10 offset 0 [] []
+[2025-07-17 06:58:21] sql.INFO: [10.67] select count(*) as aggregate from `chat_groups_members` inner join `chat_topics` on `chat_topics`.`group_id` = `chat_groups_members`.`group_id` left join `chat_topic_class` on `chat_topic_class`.`id` = `chat_topics`.`type` where (`chat_groups_members`.`user_id` = '214') [] []
+[2025-07-17 06:58:21] sql.INFO: [4.68] select `chat_topics`.*, `chat_topic_class`.`topicname` from `chat_groups_members` inner join `chat_topics` on `chat_topics`.`group_id` = `chat_groups_members`.`group_id` left join `chat_topic_class` on `chat_topic_class`.`id` = `chat_topics`.`type` where (`chat_groups_members`.`user_id` = '214') order by `chat_topics`.`created_at` desc limit 10 offset 0 [] []
+[2025-07-17 06:58:59] sql.INFO: [3.62] select count(*) as aggregate from `chat_groups_members` inner join `chat_topics` on `chat_topics`.`group_id` = `chat_groups_members`.`group_id` left join `chat_topic_class` on `chat_topic_class`.`id` = `chat_topics`.`type` where (`chat_groups_members`.`user_id` = '214') [] []
+[2025-07-17 06:58:59] sql.INFO: [4.33] select `chat_topics`.*, `chat_topic_class`.`topicname` from `chat_groups_members` inner join `chat_topics` on `chat_topics`.`group_id` = `chat_groups_members`.`group_id` left join `chat_topic_class` on `chat_topic_class`.`id` = `chat_topics`.`type` where (`chat_groups_members`.`user_id` = '214') order by `chat_topics`.`created_at` desc limit 10 offset 0 [] []
+[2025-07-17 06:59:08] sql.INFO: [2.93] insert into `chat_records` (`action`, `content`, `group_receiver_id`, `is_read`, `msg_type`, `receiver_id`, `talk_type`, `user_id`) values ('said', 'kk', '214', '1', '1', '804364907431698433', '2', '214') [] []
+[2025-07-17 06:59:11] sql.INFO: [4.08] select count(*) as aggregate from `chat_groups_members` inner join `chat_topics` on `chat_topics`.`group_id` = `chat_groups_members`.`group_id` left join `chat_topic_class` on `chat_topic_class`.`id` = `chat_topics`.`type` where (`chat_groups_members`.`user_id` = '214') [] []
+[2025-07-17 06:59:11] sql.INFO: [4.49] select `chat_topics`.*, `chat_topic_class`.`topicname` from `chat_groups_members` inner join `chat_topics` on `chat_topics`.`group_id` = `chat_groups_members`.`group_id` left join `chat_topic_class` on `chat_topic_class`.`id` = `chat_topics`.`type` where (`chat_groups_members`.`user_id` = '214') order by `chat_topics`.`created_at` desc limit 10 offset 0 [] []
+[2025-07-17 07:01:55] sql.INFO: [17.13] select count(*) as aggregate from `chat_groups_members` inner join `chat_topics` on `chat_topics`.`group_id` = `chat_groups_members`.`group_id` left join `chat_topic_class` on `chat_topic_class`.`id` = `chat_topics`.`type` where (`chat_groups_members`.`user_id` = '214') [] []
+[2025-07-17 07:01:55] sql.INFO: [4.33] select `chat_topics`.`id`, `chat_topics`.`title`, `chat_topics`.`author`, `chat_topics`.`created_at`, `chat_topics`.`updated_at`, `chat_topic_class`.`topicname` from `chat_groups_members` inner join `chat_topics` on `chat_topics`.`group_id` = `chat_groups_members`.`group_id` left join `chat_topic_class` on `chat_topic_class`.`id` = `chat_topics`.`type` where (`chat_groups_members`.`user_id` = '214') order by `chat_topics`.`created_at` desc limit 10 offset 0 [] []
+[2025-07-17 07:03:06] sql.INFO: [13.7] select count(*) as aggregate from `chat_groups_members` inner join `chat_topics` on `chat_topics`.`group_id` = `chat_groups_members`.`group_id` left join `chat_topic_class` on `chat_topic_class`.`id` = `chat_topics`.`type` where (`chat_groups_members`.`user_id` = '214') [] []
+[2025-07-17 07:03:06] sql.INFO: [3.95] select `chat_topics`.`id`, `chat_topics`.`title`, `chat_topics`.`author`, `chat_topics`.`created_at`, `chat_topics`.`updated_at`, `chat_topic_class`.`topicname` from `chat_groups_members` inner join `chat_topics` on `chat_topics`.`group_id` = `chat_groups_members`.`group_id` left join `chat_topic_class` on `chat_topic_class`.`id` = `chat_topics`.`type` where (`chat_groups_members`.`user_id` = '214') order by `chat_topics`.`created_at` desc limit 10 offset 0 [] []