通知列表
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\admin\model\NoticeModel::noticeList |
| 所属业务 | 消息通知 |
| 来源模块/系统 | 消息通知模型 |
功能说明
通知列表
调用示例
$keywords = '示例关键字';
$read = 1;
$type = 'string';
$page = 1;
$limit = 20;
$orderby = 'id';
$sort = 'asc';
$result = (new \app\admin\model\NoticeModel())->noticeList($keywords, $read, $type, $page, $limit, $orderby, $sort);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
keywords | string | 否 | — | — | 关键字搜索,搜索范围:标题,内容 |
read | int | 否 | — | — | 是否已读:0未读消息,1已读消息 |
type | string | 否 | — | — | 消息类型:idcsmart官方通知,system系统通知 |
page | int | 否 | — | — | 页数 |
limit | int | 否 | — | — | 每页条数 |
orderby | string | 否 | — | — | 排序字段,默认id |
sort | string | 否 | — | — | 排序(desc,asc) |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
list | object | 通知列表 |
list[].id | int | ID |
list[].title | string | 标题 |
list[].content | string | 内容 |
list[].attachment | string | 附件,逗号分隔 |
list[].accept_time | int | 接收时间 |
list[].read | int | 是否已读:1是,0否 |
list[].type | string | 消息类型:idcsmart官方通知,system系统通知 |
list[].rel_id | int | 关联ID,消息类型是idcsmart时,表示官方消息ID |
count | int | 总数 |
total_count | int | 所有消息未读总数 |
正常返回
{
"list": [
{
"id": 1,
"title": "示例名称",
"content": "string",
"attachment": "string",
"accept_time": 1752984000,
"read": 1,
"type": "string",
"rel_id": 1
}
],
"count": 1,
"total_count": 1
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |