- get and cancel promotion
This commit is contained in:
@@ -4,18 +4,25 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
PromotionStatusLocalCreated = 0 // 本地成功创建,
|
||||
PromotionStatusRemoteFailed = 1 // 远程创建失败,
|
||||
PromotionStatusRemoteCreated = 2 // 远程成功创建,
|
||||
PromotionStatusCanceled = 3 // 被显示取消
|
||||
PromotionStatusEnded = 4 // 已经超过活动时间,且被显示置为结束
|
||||
)
|
||||
|
||||
type Promotion struct {
|
||||
ModelIDCULD
|
||||
|
||||
VendorID int `orm:"column(vendor_id)"`
|
||||
Name string `orm:"size(64)" json:"name"`
|
||||
Type int
|
||||
Status int
|
||||
SyncStatus int
|
||||
VendorID int `orm:"column(vendor_id)"`
|
||||
Name string `orm:"size(64)" json:"name"`
|
||||
Advertising string `orm:"size(255)" json:"advertising"`
|
||||
Type int `json:"type"`
|
||||
Status int `json:"status"`
|
||||
VendorPromotionID string `orm:"size(64);column(vendor_promotion_id);index" json:"vendorPromotionID"`
|
||||
BeginAt time.Time `orm:"type(datetime);index" json:"beginAt"`
|
||||
EndAt time.Time `orm:"type(datetime);index" json:"endAt"`
|
||||
Params string `orm:"type(text)" json:"params"`
|
||||
}
|
||||
|
||||
func (*Promotion) TableUnique() [][]string {
|
||||
@@ -23,3 +30,31 @@ func (*Promotion) TableUnique() [][]string {
|
||||
[]string{"Name", "VendorID", "Type", "DeletedAt"},
|
||||
}
|
||||
}
|
||||
|
||||
type PromotionStore struct {
|
||||
ID int `orm:"column(id)" json:"id"`
|
||||
PromotionID int `orm:"column(promotion_id)" json:"promotionID"`
|
||||
StoreID int `orm:"column(store_id)" json:"storeID"`
|
||||
}
|
||||
|
||||
func (*PromotionStore) TableUnique() [][]string {
|
||||
return [][]string{
|
||||
[]string{"PromotionID", "StoreID"},
|
||||
}
|
||||
}
|
||||
|
||||
type PromotionSku struct {
|
||||
ID int `orm:"column(id)" json:"id"`
|
||||
PromotionID int `orm:"column(promotion_id)" json:"promotionID"`
|
||||
SkuID int `orm:"column(sku_id)" json:"skuID"`
|
||||
PriceType int `json:"priceType"`
|
||||
Price int `json:"price"` // 分,活动价,这个不是单价
|
||||
LimitSkuCount int `json:"limitSkuCount"`
|
||||
IsLock int8 `json:"isLock"` // 是否锁定门店商品信息
|
||||
}
|
||||
|
||||
func (*PromotionSku) TableUnique() [][]string {
|
||||
return [][]string{
|
||||
[]string{"PromotionID", "SkuID"},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user