智简魔方文档

通知列表

方法概览

项目内容
文档类型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);

参数

参数类型必填默认值校验规则说明
keywordsstring关键字搜索,搜索范围:标题,内容
readint是否已读:0未读消息,1已读消息
typestring消息类型:idcsmart官方通知,system系统通知
pageint页数
limitint每页条数
orderbystring排序字段,默认id
sortstring排序(desc,asc)

返回值

返回项类型说明
listobject通知列表
list[].idintID
list[].titlestring标题
list[].contentstring内容
list[].attachmentstring附件,逗号分隔
list[].accept_timeint接收时间
list[].readint是否已读:1是,0否
list[].typestring消息类型:idcsmart官方通知,system系统通知
list[].rel_idint关联ID,消息类型是idcsmart时,表示官方消息ID
countint总数
total_countint所有消息未读总数

正常返回

{
  "list": [
    {
      "id": 1,
      "title": "示例名称",
      "content": "string",
      "attachment": "string",
      "accept_time": 1752984000,
      "read": 1,
      "type": "string",
      "rel_id": 1
    }
  ],
  "count": 1,
  "total_count": 1
}

异常情况

异常类型说明
Throwable调用失败时由具体实现抛出异常,异常信息以运行时结果为准。