From b3828d2f47b1cf6255baac9ab18f46d4237c98c7 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Wed, 8 Nov 2023 14:04:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9C=AA=E8=AF=BB=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Common.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/api/controller/Common.php b/app/api/controller/Common.php index c9dcd90..6096e72 100644 --- a/app/api/controller/Common.php +++ b/app/api/controller/Common.php @@ -533,4 +533,16 @@ class Common extends ApiController } } } + + //未读消息统计 + public function msg_count() + { + $admin_id = JWT_UID; + $msg_map[] = ['to_uid', '=', $admin_id]; + $msg_map[] = ['read_time', '=', 0]; + $msg_map[] = ['status', '=', 1]; + $msg_count = Db::name('Message')->where($msg_map)->count(); + $statistics['msg_num'] = $msg_count; + $this->apiSuccess('获取成功', $statistics); + } }