|
@@ -22,6 +22,8 @@ class GoodsCategoryModel extends BaseModel
|
|
|
// 设置数据表
|
|
// 设置数据表
|
|
|
protected $table = 'goods_categorys';
|
|
protected $table = 'goods_categorys';
|
|
|
|
|
|
|
|
|
|
+ protected $appends = ['type_name'];
|
|
|
|
|
+
|
|
|
// 封面图
|
|
// 封面图
|
|
|
public function getIconAttribute($value)
|
|
public function getIconAttribute($value)
|
|
|
{
|
|
{
|
|
@@ -33,5 +35,10 @@ class GoodsCategoryModel extends BaseModel
|
|
|
{
|
|
{
|
|
|
return $value ? get_image_path($value) : '';
|
|
return $value ? get_image_path($value) : '';
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public function getTypeNameAttribute()
|
|
|
|
|
+ {
|
|
|
|
|
+ $types = ['',1=>'自营品专区',2=>'延时专区',3=>'深度体验',4=>'男神玩具',5=>'女神玩具',6=>'私密养护',7=>'情趣服饰(香水)',8=>'SM房趣(套装)',9=>'体感娃娃',10=>'周边产品'];
|
|
|
|
|
+ return isset($types[$this->type]) ? $types[$this->type] : '';
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|