__('Visible_switch 0'), '1' => __('Visible_switch 1')]; } public function getVisibleSwitchTextAttr($value, $data) { $value = $value ? $value : (isset($data['visible_switch']) ? $data['visible_switch'] : ''); $list = $this->getVisibleSwitchList(); return isset($list[$value]) ? $list[$value] : ''; } public function noticeevent() { return $this->belongsTo('NoticeEvent', 'notice_event_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function getUrlTypeList() { $type = $this['type'] ?? ''; if ($type == 'msg') { return [1 => '链接', 2=>'弹窗', 3=>'新窗口']; } if ($type == 'mptemplate' || $type == 'miniapp') { return [1 => '链接']; } return [1 => '链接', 2=>'弹窗', 3=>'新窗口']; } }