__('Normal'), 'hidden' => __('Hidden')]; } public function getClassTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['class_time']) ? $data['class_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setClassTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } /** * 关联查询 * 品牌商 */ public function brand(){ return $this->belongsTo('\\app\\admin\\model\\xilufitness\\brand\\Index','brand_id','id',[],'LEFT')->setEagerlyType(0); } }