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); + } }