将sale删除 并改为self

This commit is contained in:
Administrator 2026-06-18 18:08:09 +08:00
parent 0f2a789a26
commit 6fef0de888
2 changed files with 37 additions and 37 deletions

View File

@ -6,12 +6,12 @@ type InventoryDetail struct {
WarehouseID int64 `json:"warehouse_id" gorm:"not null;default:0;index;comment:仓库ID"` // 仓库ID WarehouseID int64 `json:"warehouse_id" gorm:"not null;default:0;index;comment:仓库ID"` // 仓库ID
LocationID int64 `json:"location_id" gorm:"not null;default:0;uniqueIndex:uk_location_product_batch;index;comment:库位ID"` // 库位ID LocationID int64 `json:"location_id" gorm:"not null;default:0;uniqueIndex:uk_location_product_batch;index;comment:库位ID"` // 库位ID
ProductID int64 `json:"product_id" gorm:"not null;default:0;uniqueIndex:uk_location_product_batch;index;comment:商品ID"` // 商品ID ProductID int64 `json:"product_id" gorm:"not null;default:0;uniqueIndex:uk_location_product_batch;index;comment:商品ID"` // 商品ID
BatchNo string `json:"batch_no" gorm:"size:100;not null;default:'';uniqueIndex:uk_location_product_batch;index;comment:批次号"` // BatchNo string `json:"batch_no" gorm:"size:100;not null;default:'';uniqueIndex:uk_location_product_batch;index;comment:批次号"` // 批次号
ProductionDate int64 `json:"production_date" gorm:"not null;default:0;comment:生产日期时间戳(秒)"` ProductionDate int64 `json:"production_date" gorm:"not null;default:0;comment:生产日期时间戳(秒)"` // 生产日期时间戳(秒)
ExpiryDate int64 `json:"expiry_date" gorm:"not null;default:0;index;comment:失效日期时间戳(秒)"` ExpiryDate int64 `json:"expiry_date" gorm:"not null;default:0;index;comment:失效日期时间戳(秒)"` // 失效日期时间戳(秒)
Quantity int64 `json:"quantity" gorm:"not null;default:0;comment:当前数量(最小单位)"` Quantity int64 `json:"quantity" gorm:"not null;default:0;comment:当前数量(最小单位)"` // 当前数量(最小单位)
LockedQuantity int64 `json:"locked_quantity" gorm:"not null;default:0;comment:锁定数量"` LockedQuantity int64 `json:"locked_quantity" gorm:"not null;default:0;comment:锁定数量"` // 锁定数量
AvailableQuantity int64 `json:"available_quantity" gorm:"->;comment:可用数量"` AvailableQuantity int64 `json:"available_quantity" gorm:"->;comment:可用数量"` // 可用数量
CreatedAt int64 `json:"created_at" gorm:"type:bigint;not null;default:0;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:更新时间戳(秒)"` 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:已删除)"` IsDel int8 `json:"is_del" gorm:"type:tinyint(1);not null;default:0;comment:逻辑删除标记(0:未删除,1:已删除)"`

View File

@ -7,37 +7,37 @@ import (
// ProductBook 商品书籍分表按ISBN后两位分表 product_book_00 ~ product_book_99 // ProductBook 商品书籍分表按ISBN后两位分表 product_book_00 ~ product_book_99
type ProductBook struct { type ProductBook struct {
ID int64 `json:"id" gorm:"primarykey;comment:自增ID"` ID int64 `json:"id" gorm:"primarykey;comment:自增ID"`
SelfID int64 `json:"self_id" gorm:"not null;default:0;comment:再分库商品表中的商品ID"` SelfID int64 `json:"self_id" gorm:"not null;default:0;comment:再分库商品表中的商品ID"`
CategoryID int64 `json:"category_id" gorm:"not null;default:0;comment:分类ID"` CategoryID int64 `json:"category_id" gorm:"not null;default:0;comment:分类ID"`
AboutId int64 `json:"about_id" gorm:"not null;default:0;index;comment:关联ID"` AboutId int64 `json:"about_id" gorm:"not null;default:0;index;comment:关联ID"`
WarehouseID int64 `json:"warehouse_id" gorm:"not null;default:0;index;comment:仓库ID"` WarehouseID int64 `json:"warehouse_id" gorm:"not null;default:0;index;comment:仓库ID"`
WarehouseName string `json:"warehouse_name" gorm:"size:100;not null;default:'';comment:仓库名称"` WarehouseName string `json:"warehouse_name" gorm:"size:100;not null;default:'';comment:仓库名称"`
LocationID int64 `json:"location_id" gorm:"not null;default:0;index;comment:货位ID"` LocationID int64 `json:"location_id" gorm:"not null;default:0;index;comment:货位ID"`
LocationName string `json:"location_name" gorm:"size:50;not null;default:'';comment:货位名称"` LocationName string `json:"location_name" gorm:"size:50;not null;default:'';comment:货位名称"`
StandardProductID int64 `json:"standard_product_id" gorm:"not null;default:0;index;comment:关联标品ID"` StandardProductID int64 `json:"standard_product_id" gorm:"not null;default:0;index;comment:关联标品ID"`
Fid int64 `json:"fid" gorm:"not null;default:0;comment:父级ID"` Fid int64 `json:"fid" gorm:"not null;default:0;comment:父级ID"`
Type int8 `json:"type" gorm:"not null;default:0;comment:类型 1正常 2套装书 3一号多书 4无书号"` Type int8 `json:"type" gorm:"not null;default:0;comment:类型 1正常 2套装书 3一号多书 4无书号"`
ISBN string `json:"isbn" gorm:"size:20;not null;default:'';index:idx_isbn;comment:ISBN"` ISBN string `json:"isbn" gorm:"size:20;not null;default:'';index:idx_isbn;comment:ISBN"`
FISBN string `json:"f_isbn" gorm:"size:20;not null;default:'';comment:FISBN"` FISBN string `json:"f_isbn" gorm:"size:20;not null;default:'';comment:FISBN"`
BookName string `json:"book_name" gorm:"size:100;not null;default:'';comment:书名"` BookName string `json:"book_name" gorm:"size:100;not null;default:'';comment:书名"`
FBookName string `json:"f_book_name" gorm:"size:100;not null;default:'';comment:副书名"` FBookName string `json:"f_book_name" gorm:"size:100;not null;default:'';comment:副书名"`
Author string `json:"author" gorm:"size:100;not null;default:'';comment:作者"` Author string `json:"author" gorm:"size:100;not null;default:'';comment:作者"`
Publishing string `json:"publishing" gorm:"size:50;not null;default:'';comment:出版社"` Publishing string `json:"publishing" gorm:"size:50;not null;default:'';comment:出版社"`
PublicationTime int64 `json:"publication_time" gorm:"type:bigint;not null;default:0;comment:出版日期时间戳"` PublicationTime int64 `json:"publication_time" gorm:"type:bigint;not null;default:0;comment:出版日期时间戳"`
Binding string `json:"binding" gorm:"size:10;not null;default:'';comment:装帧"` Binding string `json:"binding" gorm:"size:10;not null;default:'';comment:装帧"`
PagesCount int64 `json:"pages_count" gorm:"not null;default:0;comment:页数"` PagesCount int64 `json:"pages_count" gorm:"not null;default:0;comment:页数"`
WordsCount int64 `json:"words_count" gorm:"not null;default:0;comment:字数"` WordsCount int64 `json:"words_count" gorm:"not null;default:0;comment:字数"`
Format int64 `json:"format" gorm:"not null;default:0;comment:开本"` Format int64 `json:"format" gorm:"not null;default:0;comment:开本"`
CatID datatypes.JSON `json:"cat_id" gorm:"type:json;not null;comment:类目json"` CatID datatypes.JSON `json:"cat_id" gorm:"type:json;not null;comment:类目json"`
Name string `json:"name" gorm:"size:255;not null;default:'';comment:商品名称"` Name string `json:"name" gorm:"size:255;not null;default:'';comment:商品名称"`
Appearance int64 `json:"appearance" gorm:"not null;default:0;comment:品相"` Appearance int64 `json:"appearance" gorm:"not null;default:0;comment:品相"`
Barcode string `json:"barcode" gorm:"size:100;not null;default:'';index;comment:条码"` Barcode string `json:"barcode" gorm:"size:100;not null;default:'';index;comment:条码"`
Price int64 `json:"price" gorm:"not null;default:0;comment:价格"` Price int64 `json:"price" gorm:"not null;default:0;comment:价格"`
SalePrice int64 `json:"sale_price" gorm:"not null;default:0;comment:书价"` SalePrice int64 `json:"sale_price" gorm:"not null;default:0;comment:书价"`
Cost int64 `json:"cost" gorm:"not null;default:0;comment:最低运费"` Cost int64 `json:"cost" gorm:"not null;default:0;comment:最低运费"`
Stock int64 `json:"stock" gorm:"not null;default:0;comment:库存"` Stock int64 `json:"stock" gorm:"not null;default:0;comment:库存"`
SaleID int64 `json:"sale_id" gorm:"not null;default:0;comment:销售ID"`
LiveImage datatypes.JSON `json:"live_image" gorm:"type:json;not null;comment:实拍图json"` LiveImage datatypes.JSON `json:"live_image" gorm:"type:json;not null;comment:实拍图json"`
IsBatchManaged int8 `json:"is_batch_managed" gorm:"type:tinyint(1);not null;default:0;comment:是否批次管理(0:否,1:是)"` IsBatchManaged int8 `json:"is_batch_managed" gorm:"type:tinyint(1);not null;default:0;comment:是否批次管理(0:否,1:是)"`
IsShelfLifeManaged int8 `json:"is_shelf_life_managed" gorm:"type:tinyint(1);not null;default:0;comment:是否效期管理(0:否,1:是)"` IsShelfLifeManaged int8 `json:"is_shelf_life_managed" gorm:"type:tinyint(1);not null;default:0;comment:是否效期管理(0:否,1:是)"`