fix : 주문 테이블 모델링 -> 추후 변경예정 (견적, 수주, 발주에 대한 각각의 컬럼을 위한 테이블 필요)
This commit is contained in:
38
app/Models/Orders/Order.php
Normal file
38
app/Models/Orders/Order.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Orders;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Order extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
// 주문(견적/수주/발주 메인)
|
||||
protected $table = 'orders';
|
||||
|
||||
protected $fillable = [
|
||||
'tenant_id', 'order_no', 'order_type_code', 'status_code', 'category_code', 'product_id',
|
||||
'received_at', 'writer_id', 'client_id', 'client_contact', 'site_name', 'quantity', 'delivery_date',
|
||||
'delivery_method_code', 'memo'
|
||||
];
|
||||
|
||||
// 상세(라인)
|
||||
public function items()
|
||||
{
|
||||
return $this->hasMany(OrderItem::class);
|
||||
}
|
||||
|
||||
// 이력
|
||||
public function histories()
|
||||
{
|
||||
return $this->hasMany(OrderHistory::class);
|
||||
}
|
||||
|
||||
// 버전관리
|
||||
public function versions()
|
||||
{
|
||||
return $this->hasMany(OrderVersion::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user