'全部', self::Announ => '公告', self::Banner => '轮播图' ]; //1":__('公告'),"2":__('轮播图'),"3":__('茶说'),"4":__('合成公告' public static function getTypeList() { return [1 => __('公告'), 2 => __('轮播图'), 3 => __('茶说'), 4 => __('合成公告')]; } public function getCreatetimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['createtime']) ? $data['createtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getUpdatetimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['updatetime']) ? $data['updatetime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } protected function setCreatetimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setUpdatetimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } }