01 2022 Microsite Promotion
This commit is contained in:
parent
3f1fb9377d
commit
38e7fd504a
39 changed files with 761 additions and 336 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Services\Type;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
|
|
@ -28,8 +29,12 @@ class ProductCategory extends Model
|
|||
{
|
||||
protected $table = 'product_categories';
|
||||
|
||||
protected $casts = [
|
||||
'show_on' => 'array',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'product_id', 'category_id',
|
||||
'pos', 'product_id', 'category_id', 'show_on'
|
||||
];
|
||||
|
||||
public function product()
|
||||
|
|
@ -42,4 +47,12 @@ class ProductCategory extends Model
|
|||
return $this->belongsTo('App\Models\Category', 'category_id');
|
||||
}
|
||||
|
||||
public function getShowOnTypes(){
|
||||
$ret = [];
|
||||
foreach($this->show_on as $show){
|
||||
$ret[] = isset(Type::$showONs[$show]) ? Type::$showONs[$show] : '-';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue