__('Hasview y'), 'N' => __('Hasview n')]; } public function getStatusList() { return ['normal' => __('Normal'), 'hidden' => __('Hidden')]; } public function getHasviewTextAttr($value, $data) { $value = $value ? $value : (isset($data['hasview']) ? $data['hasview'] : ''); $list = $this->getHasviewList(); return isset($list[$value]) ? $list[$value] : ''; } public function getViewtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['viewtime']) ? $data['viewtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setViewtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } }