From d5ed423cbe89c31ec449c8da69f6633da5d04be0 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq.com> Date: Wed, 9 Jul 2025 10:10:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=8A=E5=A4=A9=E8=AE=B0=E5=BD=95=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E6=97=B6=E9=97=B4=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/enterprise/controller/Im.php | 9 +++++++++ public/sql/database.sql | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/enterprise/controller/Im.php b/app/enterprise/controller/Im.php index 62156e5..94c8786 100644 --- a/app/enterprise/controller/Im.php +++ b/app/enterprise/controller/Im.php @@ -251,6 +251,15 @@ class Im extends BaseController $where[] = ['type', '<>', 'event']; } } + if (isset($param['search_date'])) { + $search_date = strtotime($param['search_date']); + if ($search_date) { + $start_date = strtotime(date("Y-m-d 00:00:00", $search_date)); + $end_date = strtotime(date("Y-m-d 23:59:59")); + $where[] = ['create_time', '>=', $start_date]; + $where[] = ['create_time', '<=', $end_date]; + } + } // 群聊查询入群时间以后的消息 if($is_group==1){ $group_id = explode('-', $param['toContactId'])[1]; diff --git a/public/sql/database.sql b/public/sql/database.sql index 766e101..ae5abb6 100644 --- a/public/sql/database.sql +++ b/public/sql/database.sql @@ -148,7 +148,10 @@ CREATE TABLE `yu_message` ( `extends` json DEFAULT NULL COMMENT '消息扩展内容', `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态', `del_user` text COLLATE utf8mb4_unicode_ci COMMENT '已删除成员', - `delete_time` int(11) NOT NULL DEFAULT '0' COMMENT '删除时间' + `delete_time` int(11) NOT NULL DEFAULT '0' COMMENT '删除时间', + `plain_text` text COLLATE utf8mb4_unicode_ci COMMENT '消息内容纯文本', + PRIMARY KEY (`msg_id`), + KEY `chat_identify` (`chat_identify`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- --------------------------------------------------------