- make PromotionStore and PromotionSku ModelIDCULD
This commit is contained in:
@@ -269,6 +269,7 @@ func CreateJdPromotion(ctx *jxcontext.Context, isIDJd bool, isAsync bool, params
|
|||||||
PromotionID: promotion.ID,
|
PromotionID: promotion.ID,
|
||||||
StoreID: storeID,
|
StoreID: storeID,
|
||||||
}
|
}
|
||||||
|
dao.WrapAddIDCULDEntity(promotionStore, ctx.GetUserName())
|
||||||
if err = dao.CreateEntity(db, promotionStore); err != nil {
|
if err = dao.CreateEntity(db, promotionStore); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
@@ -281,6 +282,7 @@ func CreateJdPromotion(ctx *jxcontext.Context, isIDJd bool, isAsync bool, params
|
|||||||
Price: skuPrice.Price,
|
Price: skuPrice.Price,
|
||||||
LimitSkuCount: skuPrice.LimitSkuCount,
|
LimitSkuCount: skuPrice.LimitSkuCount,
|
||||||
}
|
}
|
||||||
|
dao.WrapAddIDCULDEntity(promotionSku, ctx.GetUserName())
|
||||||
if err = dao.CreateEntity(db, promotionSku); err != nil {
|
if err = dao.CreateEntity(db, promotionSku); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,19 +32,21 @@ func (*Promotion) TableUnique() [][]string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PromotionStore struct {
|
type PromotionStore struct {
|
||||||
ID int `orm:"column(id)" json:"id"`
|
ModelIDCULD
|
||||||
|
|
||||||
PromotionID int `orm:"column(promotion_id)" json:"promotionID"`
|
PromotionID int `orm:"column(promotion_id)" json:"promotionID"`
|
||||||
StoreID int `orm:"column(store_id)" json:"storeID"`
|
StoreID int `orm:"column(store_id)" json:"storeID"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*PromotionStore) TableUnique() [][]string {
|
func (*PromotionStore) TableUnique() [][]string {
|
||||||
return [][]string{
|
return [][]string{
|
||||||
[]string{"PromotionID", "StoreID"},
|
[]string{"PromotionID", "StoreID", "DeletedAt"},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type PromotionSku struct {
|
type PromotionSku struct {
|
||||||
ID int `orm:"column(id)" json:"id"`
|
ModelIDCULD
|
||||||
|
|
||||||
PromotionID int `orm:"column(promotion_id)" json:"promotionID"`
|
PromotionID int `orm:"column(promotion_id)" json:"promotionID"`
|
||||||
SkuID int `orm:"column(sku_id)" json:"skuID"`
|
SkuID int `orm:"column(sku_id)" json:"skuID"`
|
||||||
PriceType int `json:"priceType"`
|
PriceType int `json:"priceType"`
|
||||||
@@ -55,6 +57,6 @@ type PromotionSku struct {
|
|||||||
|
|
||||||
func (*PromotionSku) TableUnique() [][]string {
|
func (*PromotionSku) TableUnique() [][]string {
|
||||||
return [][]string{
|
return [][]string{
|
||||||
[]string{"PromotionID", "SkuID"},
|
[]string{"PromotionID", "SkuID", "DeletedAt"},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user