__('Jointype 1'), '0' => __('Jointype 0')]; } public function getHavetypeList() { return ['1' => __('Havetype 1'), '0' => __('Havetype 0')]; } public function getTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['time']) ? $data['time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getJointypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['jointype']) ? $data['jointype'] : ''); $list = $this->getJointypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getHavetypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['havetype']) ? $data['havetype'] : ''); $list = $this->getHavetypeList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function lib() { return $this->belongsTo('Lib', 'classes_lib_id', 'id', [], 'LEFT')->setEagerlyType(0); } }