daShangDao_psiServer/models/sales_order_item.go
2026-06-15 13:47:39 +08:00

30 lines
1.9 KiB
Go

package models
// SalesOrderItem 销售订单明细表
type SalesOrderItem struct {
ID int64 `json:"id" gorm:"primarykey;comment:明细ID"`
SalesOrderID int64 `json:"sales_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:订购数量(最小单位)"`
AllocatedQuantity int64 `json:"allocated_quantity" gorm:"not null;default:0;comment:已分配数量"`
ShippedQuantity int64 `json:"shipped_quantity" gorm:"not null;default:0;comment:已发货数量"`
UnitPrice int64 `json:"unit_price" gorm:"not null;default:0;comment:单价(分/基本单位)"`
Amount int64 `json:"amount" gorm:"->;comment:金额(分)"`
ReceiverName string `json:"receiver_name" gorm:"size:100;not null;default:'';comment:收货人姓名"`
ReceiverPhone string `json:"receiver_phone" gorm:"size:20;not null;default:'';comment:收货人电话"`
ReceiverAddress string `json:"receiver_address" gorm:"size:200;not null;default:'';comment:收货地址"`
LogisticsCompany string `json:"logistics_company" gorm:"size:100;not null;default:'';comment:物流公司"`
LogisticsNo string `json:"logistics_no" gorm:"size:100;not null;default:'';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 (SalesOrderItem) TableName() string {
return "sales_order_item"
}
func (SalesOrderItem) TableOptions() string {
return "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='销售订单明细表'"
}