52 lines
1.0 KiB
PHP
52 lines
1.0 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models\ItemMaster;
|
||
|
|
|
||
|
|
use App\Traits\BelongsToTenant;
|
||
|
|
use App\Traits\ModelTrait;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||
|
|
|
||
|
|
class ItemBomItem extends Model
|
||
|
|
{
|
||
|
|
use BelongsToTenant, ModelTrait, SoftDeletes;
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'tenant_id',
|
||
|
|
'section_id',
|
||
|
|
'item_code',
|
||
|
|
'item_name',
|
||
|
|
'quantity',
|
||
|
|
'unit',
|
||
|
|
'unit_price',
|
||
|
|
'total_price',
|
||
|
|
'spec',
|
||
|
|
'note',
|
||
|
|
'created_by',
|
||
|
|
'updated_by',
|
||
|
|
'deleted_by',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'quantity' => 'decimal:4',
|
||
|
|
'unit_price' => 'decimal:2',
|
||
|
|
'total_price' => 'decimal:2',
|
||
|
|
'created_at' => 'datetime',
|
||
|
|
'updated_at' => 'datetime',
|
||
|
|
'deleted_at' => 'datetime',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $hidden = [
|
||
|
|
'deleted_by',
|
||
|
|
'deleted_at',
|
||
|
|
];
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 소속 섹션
|
||
|
|
*/
|
||
|
|
public function section()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(ItemSection::class, 'section_id');
|
||
|
|
}
|
||
|
|
}
|