package models // PurchaseOrderItem 采购订单明细表 type PurchaseOrderItem struct { ID int64 `json:"id" gorm:"primarykey;comment:明细ID"` PurchaseOrderID int64 `json:"purchase_order_id" gorm:"not null;default:0;index;comment:采购单ID"` ProductID int64 `json:"product_id" gorm:"not null;default:0;index;comment:商品ID"` Quantity int64 `json:"quantity" gorm:"not null;default:0;comment:采购数量(最小单位)"` ReceivedQuantity int64 `json:"received_quantity" gorm:"not null;default:0;comment:已入库数量"` UnitPrice int64 `json:"unit_price" gorm:"not null;default:0;comment:单价(单位:分/基本单位)"` Amount int64 `json:"amount" gorm:"comment:金额(分)"` CreatedAt int64 `json:"created_at" gorm:"type:bigint;not null;default:0;comment:创建时间戳(秒)"` UpdatedAt int64 `json:"updated_at" gorm:"type:bigint;not null;default:0;comment:更新时间戳(秒)"` IsDel int8 `json:"is_del" gorm:"type:tinyint(1);not null;default:0;comment:逻辑删除标记(0:未删除,1:已删除)"` } func (PurchaseOrderItem) TableName() string { return "purchase_order_item" } func (PurchaseOrderItem) TableOptions() string { return "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='采购订单明细表'" }