__('Chepaicolor 5'), '1' => __('Chepaicolor 1'), '2' => __('Chepaicolor 2'), '3' => __('Chepaicolor 3'), '4' => __('Chepaicolor 4'), '9' => __('Chepaicolor 9'), '91' => __('Chepaicolor 91'), '92' => __('Chepaicolor 92'), '94' => __('Chepaicolor 94'), '224' => __('Chepaicolor 224'), '225' => __('Chepaicolor 225')]; } public function getIsEtcList() { return ['0' => __('Is_etc 0'), '1' => __('Is_etc 1')]; } public function getPowerList() { return ['1' => __('Power 1'), '2' => __('Power 2')]; } public function getLeasetypeList() { return ['1' => __('Leasetype 1'), '2' => __('Leasetype 2'), '3' => __('Leasetype 3')]; } public function getChepaicolorTextAttr($value, $data) { $value = $value ? $value : (isset($data['chepaicolor']) ? $data['chepaicolor'] : ''); $list = $this->getChepaicolorList(); return isset($list[$value]) ? $list[$value] : ''; } public function getIsEtcTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_etc']) ? $data['is_etc'] : ''); $list = $this->getIsEtcList(); return isset($list[$value]) ? $list[$value] : ''; } public function getPowerTextAttr($value, $data) { $value = $value ? $value : (isset($data['power']) ? $data['power'] : ''); $list = $this->getPowerList(); return isset($list[$value]) ? $list[$value] : ''; } public function getZhucetimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['zhucetime']) ? $data['zhucetime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getLeasetypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['leasetype']) ? $data['leasetype'] : ''); $list = $this->getLeasetypeList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setZhucetimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } }