getStatusList(); return $list[$value] ?? ''; } public function getStyleTypeTextAttr($value, $data) { $value = $value ?: ($data['style_type'] ?? ''); $list = $this->getStyleTypeList(); return $list[$value] ?? ''; } public function group() { return $this->belongsTo('GoodsLabelGroup', 'group_id', 'id'); } public function getColorJsonAttr($value) { return is_string($value) ? (json_decode($value, true) ?: []) : []; } public function setColorJsonAttr($value) { return is_array($value) ? json_encode($value) : $value; } }