fix : 주문 테이블 모델링 -> 추후 변경예정 (견적, 수주, 발주에 대한 각각의 컬럼을 위한 테이블 필요)
This commit is contained in:
30
app/Models/Orders/OrderItem.php
Normal file
30
app/Models/Orders/OrderItem.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Orders;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class OrderItem extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
// 주문 상세
|
||||
protected $table = 'order_items';
|
||||
|
||||
protected $fillable = [
|
||||
'tenant_id', 'order_id', 'serial_no', 'product_id', 'quantity',
|
||||
'status_code', 'design_code', 'remarks', 'attributes'
|
||||
];
|
||||
|
||||
// 투입 구성(자재/BOM 등)
|
||||
public function components()
|
||||
{
|
||||
return $this->hasMany(OrderItemComponent::class);
|
||||
}
|
||||
|
||||
public function order()
|
||||
{
|
||||
return $this->belongsTo(Order::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user