- PromotionStatusName

This commit is contained in:
gazebo
2018-11-05 19:02:10 +08:00
parent 42e96f3451
commit 594ca76de3
2 changed files with 15 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ func InitServiceInfo(version, buildDate, gitCommit string) {
"orderStatus": model.OrderStatusName, "orderStatus": model.OrderStatusName,
"waybillStatus": model.WaybillStatusName, "waybillStatus": model.WaybillStatusName,
"bankName": model.BankName, "bankName": model.BankName,
"promotionStatusName": model.PromotionStatusName,
}, },
} }
Init() Init()

View File

@@ -12,6 +12,10 @@ const (
PromotionStatusEnded = 4 // 已经超过活动时间,且被显示置为结束 PromotionStatusEnded = 4 // 已经超过活动时间,且被显示置为结束
) )
var (
PromotionStatusName map[int]string
)
type Promotion struct { type Promotion struct {
ModelIDCULD ModelIDCULD
@@ -25,6 +29,16 @@ type Promotion struct {
EndAt time.Time `orm:"type(datetime);index" json:"endAt"` EndAt time.Time `orm:"type(datetime);index" json:"endAt"`
} }
func init() {
PromotionStatusName = map[int]string{
PromotionStatusLocalCreated: "创建中",
PromotionStatusRemoteFailed: "失败",
PromotionStatusRemoteCreated: "正常",
PromotionStatusCanceled: "取消",
PromotionStatusEnded: "结束",
}
}
func (*Promotion) TableUnique() [][]string { func (*Promotion) TableUnique() [][]string {
return [][]string{ return [][]string{
[]string{"Name", "VendorID", "Type", "DeletedAt"}, []string{"Name", "VendorID", "Type", "DeletedAt"},