30 lines
547 B
PHP
30 lines
547 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class GoodsAttr extends Model
|
|
{
|
|
use HasDateTimeFormatter;
|
|
protected $table = 'goods_attrs';
|
|
|
|
protected $fillable = [
|
|
'attr_id',
|
|
'attr_name',
|
|
'attr_value',
|
|
'value_price',
|
|
'is_use'
|
|
];
|
|
|
|
public function goods(){
|
|
return $this->belongsTo(Good::class, 'goods_id');
|
|
}
|
|
|
|
public function attr(){
|
|
return $this->belongsTo(TypeAttr::class, 'attr_id');
|
|
}
|
|
}
|