新增未读消息数

This commit is contained in:
yaooo 2023-11-08 14:04:38 +08:00
parent f41b2e7da9
commit b3828d2f47
1 changed files with 12 additions and 0 deletions

View File

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