|
|
@ -51,6 +51,8 @@ class Goods extends Model |
|
|
protected $appends = [ |
|
|
protected $appends = [ |
|
|
'month_sales', |
|
|
'month_sales', |
|
|
'cart_num', |
|
|
'cart_num', |
|
|
|
|
|
'is_effective', |
|
|
|
|
|
'noneffective_note', |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
protected function boot(): void |
|
|
protected function boot(): void |
|
|
@ -87,6 +89,16 @@ class Goods extends Model |
|
|
return (integer)$this->shopCartService->check($this->id); |
|
|
return (integer)$this->shopCartService->check($this->id); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getIsEffectiveAttribute() |
|
|
|
|
|
{ |
|
|
|
|
|
return 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getNoneffectiveNoteAttribute() |
|
|
|
|
|
{ |
|
|
|
|
|
return ''; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public function store() |
|
|
public function store() |
|
|
{ |
|
|
{ |
|
|
return $this->belongsTo(Store::class, 'store_id', 'id'); |
|
|
return $this->belongsTo(Store::class, 'store_id', 'id'); |
|
|
|