'array', ]; /** * 消息类型:0=系统消息,1=公告消息,2=需求消息 * 此处直接返回中文而非 __() 语言包:该文案会随接口返回给小程序, * 而 API 模块加载的语言包并不包含这些 key,__() 查不到会原样输出英文 */ public function getMessageTypeList() { return ['0' => '系统消息', '1' => '公告消息', '2' => '需求消息']; } public function getMessageTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['message_type']) ? $data['message_type'] : ''); $list = $this->getMessageTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getCreatetimeTextAttr($value, $data) { return date('m/d|H:i', $data['createtime'] ?? 0); } }