221 lines
6.4 KiB
Go
221 lines
6.4 KiB
Go
package model
|
||
|
||
import "time"
|
||
|
||
const (
|
||
StoreSkuBindStatusNA = -2
|
||
StoreSkuBindStatusDeleted = -1
|
||
StoreSkuBindStatusDontSale = 0
|
||
StoreSkuBindStatusNormal = 1
|
||
)
|
||
|
||
const (
|
||
MaxStoreSkuStockQty = 99999
|
||
)
|
||
|
||
const (
|
||
RequestTypeChangePrice = 1
|
||
RequestTypeFocusSkuName = 2
|
||
)
|
||
|
||
const (
|
||
RequestStatusNew = 0
|
||
RequestStatusRejected = 1
|
||
RequestStatusAccepted = 2
|
||
RequestStatusCanceled = 3
|
||
)
|
||
|
||
var (
|
||
RequestTypeName = map[int]string{
|
||
RequestTypeChangePrice: "更改价格",
|
||
RequestTypeFocusSkuName: "关注商品",
|
||
}
|
||
RequestStatusName = map[int]string{
|
||
RequestStatusNew: "待审核",
|
||
RequestStatusRejected: "拒绝",
|
||
RequestStatusAccepted: "已批准",
|
||
}
|
||
)
|
||
|
||
type StoreSkuCategoryMap struct {
|
||
ModelIDCULD
|
||
|
||
StoreID int `orm:"column(store_id)"`
|
||
CategoryID int `orm:"column(category_id)"`
|
||
|
||
// ElmID int64 `orm:"column(elm_id);index"`
|
||
EbaiID int64 `orm:"column(ebai_id);index"`
|
||
MtwmID string `orm:"column(mtwm_id);index;size(16)"`
|
||
// WscID int64 `orm:"column(wsc_id);index"`
|
||
|
||
// ElmSyncStatus int8 `orm:"default(2)"`
|
||
EbaiSyncStatus int8 `orm:"default(2)"`
|
||
MtwmSyncStatus int8 `orm:"default(2)"`
|
||
// WscSyncStatus int8 `orm:"default(2)"`
|
||
YbID int64 `orm:"column(yb_id);index"`
|
||
YbSyncStatus int8 `orm:"default(2)"`
|
||
JdsID int64 `orm:"column(jds_id);index"`
|
||
JdsSyncStatus int8 `orm:"default(2)"`
|
||
}
|
||
|
||
func (*StoreSkuCategoryMap) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"StoreID", "CategoryID", "DeletedAt"},
|
||
}
|
||
}
|
||
|
||
func (*StoreSkuCategoryMap) TableIndex() [][]string {
|
||
return [][]string{
|
||
[]string{"CategoryID", "StoreID", "DeletedAt"},
|
||
}
|
||
}
|
||
|
||
// type StoreSkuCategoryMap2 struct {
|
||
// ModelIDCULD
|
||
|
||
// StoreID int `orm:"column(store_id)"`
|
||
// VendorID int `orm:"column(vendor_id)"`
|
||
// CategoryID int `orm:"column(category_id)"`
|
||
|
||
// VendorCatID string `orm:"column(vendor_cat_id);size(48)" json:"vendorCatID"`
|
||
// SyncStatus int8 `orm:"default(2)"`
|
||
// }
|
||
|
||
// func (*StoreSkuCategoryMap2) TableUnique() [][]string {
|
||
// return [][]string{
|
||
// []string{"StoreID", "VendorID", "CategoryID", "DeletedAt"},
|
||
// }
|
||
// }
|
||
|
||
type StoreSkuBind struct {
|
||
ModelIDCULD
|
||
|
||
StoreID int `orm:"column(store_id)"`
|
||
SkuID int `orm:"column(sku_id)"`
|
||
SubStoreID int `orm:"column(sub_store_id)"`
|
||
Price int // 单位为分,不用int64的原因是这里不需要累加
|
||
UnitPrice int // 这个是一斤的门店商品价,放在这里的原因是避免额外增加一张store sku_name表,逻辑上要保证同一SKU NAME中的所有SKU这个字段的数据一致
|
||
Status int
|
||
|
||
// ElmID int64 `orm:"column(elm_id);index"`
|
||
MtwmID int64 `orm:"column(mtwm_id);index"`
|
||
EbaiID int64 `orm:"column(ebai_id);index"`
|
||
YbID int64 `orm:"column(yb_id);index"`
|
||
JdsID int64 `orm:"column(jds_id);index"`
|
||
JdsWareID int64 `orm:"column(jds_ware_id)"`
|
||
// WscID int64 `orm:"column(wsc_id);index"` // 表示微盟skuId
|
||
// WscID2 int64 `orm:"column(wsc_id2);index"` // 表示微盟goodsId
|
||
|
||
// ElmSyncStatus int8 `orm:"default(2)"`
|
||
JdSyncStatus int8 `orm:"default(2)"`
|
||
MtwmSyncStatus int8 `orm:"default(2)"`
|
||
EbaiSyncStatus int8 `orm:"default(2)"`
|
||
YbSyncStatus int8 `orm:"default(2)"`
|
||
JdsSyncStatus int8 `orm:"default(2)"` //京东商城
|
||
// WscSyncStatus int8 `orm:"default(2)"`
|
||
|
||
JdPrice int `json:"jdPrice"`
|
||
MtwmPrice int `json:"mtwmPrice"`
|
||
EbaiPrice int `json:"ebaiPrice"`
|
||
JxPrice int `json:"jxPrice"`
|
||
YbPrice int `json:"ybPrice"`
|
||
JdsPrice int `json:"jdsPrice"`
|
||
|
||
JdLockTime *time.Time `orm:"null" json:"jdLockTime"`
|
||
JdsLockTime *time.Time `orm:"null" json:"jdsLockTime"`
|
||
MtwmLockTime *time.Time `orm:"null" json:"mtwmLockTime"`
|
||
EbaiLockTime *time.Time `orm:"null" json:"ebaiLockTime"`
|
||
JxLockTime *time.Time `orm:"null" json:"jxLockTime"`
|
||
YbLockTime *time.Time `orm:"null" json:"ybLockTime"`
|
||
|
||
AutoSaleAt time.Time `orm:"type(datetime);null" json:"autoSaleAt"`
|
||
|
||
StatusSaleBegin int16 //商品可售时间范围
|
||
StatusSaleEnd int16
|
||
}
|
||
|
||
func (*StoreSkuBind) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"StoreID", "SkuID", "DeletedAt"},
|
||
}
|
||
}
|
||
|
||
func (*StoreSkuBind) TableIndex() [][]string {
|
||
return [][]string{
|
||
[]string{"SkuID", "StoreID", "DeletedAt"},
|
||
// []string{"AutoSaleAt", "DeletedAt", "StoreID"},
|
||
}
|
||
}
|
||
|
||
type StoreSkuBindHistory struct {
|
||
StoreSkuBind
|
||
StoreSkuBindID int `orm:"column(store_sku_bind_id)"`
|
||
SnapshotAt time.Time `orm:"type(datetime);null;index" json:"snapshotAt"`
|
||
}
|
||
|
||
func (*StoreSkuBindHistory) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"StoreID", "SkuID", "DeletedAt", "SnapshotAt"},
|
||
}
|
||
}
|
||
|
||
func (*StoreSkuBindHistory) TableIndex() [][]string {
|
||
return [][]string{
|
||
[]string{"SkuID", "StoreID", "DeletedAt"},
|
||
}
|
||
}
|
||
|
||
type StoreOpRequest struct {
|
||
ModelIDCULD // DeletedAt用于表示请求操作结束,而并不一定是删除
|
||
|
||
Type int8 `json:"type"`
|
||
StoreID int `orm:"column(store_id)" json:"storeID"`
|
||
ItemID int `orm:"column(item_id)" json:"itemID"` // 这个根据type不同,可能是SKUNAME ID或SKU ID
|
||
Status int8 `json:"status"`
|
||
UserID string `orm:"size(48);column(user_id)" json:"userID"`
|
||
IntParam0 int `json:"intParam0"` // 表示原价
|
||
IntParam1 int `json:"intParam1"`
|
||
IntParam2 int `json:"intParam2"`
|
||
JsonParam string `orm:"size(3000)" json:"jsonParam"`
|
||
Remark string `orm:"size(255)" json:"remark"`
|
||
}
|
||
|
||
func (*StoreOpRequest) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"StoreID", "Type", "ItemID", "DeletedAt"},
|
||
}
|
||
}
|
||
|
||
func (*StoreOpRequest) TableIndex() [][]string {
|
||
return [][]string{
|
||
[]string{"DeletedAt"},
|
||
[]string{"StoreID", "Status", "Type"},
|
||
}
|
||
}
|
||
|
||
type StoreSkuAudit struct {
|
||
ModelIDCULD // DeletedAt用于表示请求操作结束,而并不一定是删除
|
||
|
||
Type int8 `json:"type"` //1为改价
|
||
StoreID int `orm:"column(store_id)" json:"storeID"`
|
||
NameID int `orm:"column(name_id)" json:"nameID"` // 这个根据type不同,可能是SKUNAME ID或SKU ID
|
||
Status int8 `json:"status"`
|
||
UserID string `orm:"size(48);column(user_id)" json:"userID"`
|
||
OriginUnitPrice int `json:"originPrice"` // 表示原价
|
||
UnitPrice int `json:"unitPrice"`
|
||
Remark string `orm:"size(255)" json:"remark"`
|
||
}
|
||
|
||
func (*StoreSkuAudit) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"StoreID", "Type", "NameID", "DeletedAt"},
|
||
}
|
||
}
|
||
|
||
func (*StoreSkuAudit) TableIndex() [][]string {
|
||
return [][]string{
|
||
[]string{"DeletedAt"},
|
||
[]string{"StoreID", "Status", "Type"},
|
||
}
|
||
}
|