__('Type 0'), '1' => __('Type 1'), '2' => __('Type 2'), '3' => __('Type 3'), '4' => __('Type 4')]; } public function getIsCheckList() { return ['0' => __('Is_check 0'), '1' => __('Is_check 1'), '-1' => __('Is_check -1')]; } public function getTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['type']) ? $data['type'] : ''); $list = $this->getTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getStarttimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['starttime']) ? $data['starttime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getEndtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['endtime']) ? $data['endtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getIsCheckTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_check']) ? $data['is_check'] : ''); $list = $this->getIsCheckList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setStarttimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setEndtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } }