- add Promotion CreateType

This commit is contained in:
gazebo
2018-11-07 14:04:58 +08:00
parent 73df0db1f8
commit 8ad36d3095
2 changed files with 8 additions and 0 deletions

View File

@@ -295,9 +295,11 @@ func CreateJdPromotion(ctx *jxcontext.Context, isIDJd bool, isAsync, isContinueW
Status: model.PromotionStatusLocalCreated,
BeginAt: params.BeginAt,
EndAt: params.EndAt,
CreateType: model.PromotionCreateTypeByJX,
}
if vendorPromotionID != "" {
promotion.VendorPromotionID = vendorPromotionID
promotion.CreateType = model.PromotionCreateTypeByVendor
}
dao.WrapAddIDCULDEntity(promotion, userName)
// if promotion.Params, err = jxutils.SerializeData(params); err != nil {

View File

@@ -12,6 +12,11 @@ const (
PromotionStatusEnded = 4 // 已经超过活动时间,且被显示置为结束
)
const (
PromotionCreateTypeByJX = 0
PromotionCreateTypeByVendor = 1
)
var (
PromotionStatusName map[int]string
)
@@ -24,6 +29,7 @@ type Promotion struct {
Advertising string `orm:"size(255)" json:"advertising"`
Type int `json:"type"`
Status int `json:"status"`
CreateType int8 `json:"createType"`
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"`