__('Type activity'),'url' => __('Type url'),'book' => __('Type book')]; } public function getStatusList() { return ['normal' => __('Status normal'),'hidden' => __('Status hidden')]; } public function getTypeTextAttr($value, $data) { $value = $value ? $value : $data['type']; $list = $this->getTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getStarttimeTextAttr($value, $data) { $value = $value ? $value : $data['starttime']; return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getEndtimeTextAttr($value, $data) { $value = $value ? $value : $data['endtime']; return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : $data['status']; $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setStarttimeAttr($value) { return $value && !is_numeric($value) ? strtotime($value) : $value; } protected function setEndtimeAttr($value) { return $value && !is_numeric($value) ? strtotime($value) : $value; } }