__('Cart 1'), '2' => __('Cart 2')]; } public function getTypeList() { return ['1' => __('Type 1'), '2' => __('Type 2')]; } public function getCartTextAttr($value, $data) { $value = $value ? $value : (isset($data['cart']) ? $data['cart'] : ''); $list = $this->getCartList(); return isset($list[$value]) ? $list[$value] : ''; } public function getTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['type']) ? $data['type'] : ''); $list = $this->getTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getUpdateTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['update_time']) ? $data['update_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } protected function setUpdateTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } }