商品可售时间设置校验

This commit is contained in:
苏尹岚
2019-11-18 09:37:52 +08:00
parent 839a344433
commit b31adda4d5
5 changed files with 44 additions and 17 deletions

View File

@@ -252,14 +252,14 @@ type Store struct {
Address string `orm:"size(255)" json:"address"`
Tel1 string `orm:"size(32);index" json:"tel1"`
Tel2 string `orm:"size(32);index" json:"tel2"`
OpenTime1 int16 `json:"openTime1"` // 930就表示9点半用两个的原因是为了支持中午休息1与2的时间段不能交叉为0表示没有
CloseTime1 int16 `json:"closeTime1"` // 格式同上
OpenTime2 int16 `json:"openTime2"` // 格式同上
CloseTime2 int16 `json:"closeTime2"` // 格式同上
Lng int `json:"-"` // 乘了10的6次方
Lat int `json:"-"` // 乘了10的6次方
DeliveryRangeType int8 `json:"deliveryRangeType"` // 参见相关常量定义
DeliveryRange string `orm:"type(text)" json:"deliveryRange"` // 如果DeliveryRangeType为DeliveryRangeTypePolygon则为逗号分隔坐标分号分隔的坐标点坐标与Lng和Lat一样都是整数比如 121361504,31189308;121420555,31150238。否则为半径单位为米
OpenTime1 int16 `json:"openTime1" validate:"max=2359,min=1,ltfield=CloseTime1"` // 930就表示9点半用两个的原因是为了支持中午休息1与2的时间段不能交叉为0表示没有
CloseTime1 int16 `json:"closeTime1" validate:"max=2359,min=1` // 格式同上
OpenTime2 int16 `json:"openTime2" validate:"max=2359,min=1,ltfield=CloseTime2"` // 格式同上
CloseTime2 int16 `json:"closeTime2" validate:"max=2359,min=1` // 格式同上
Lng int `json:"-"` // 乘了10的6次方
Lat int `json:"-"` // 乘了10的6次方
DeliveryRangeType int8 `json:"deliveryRangeType"` // 参见相关常量定义
DeliveryRange string `orm:"type(text)" json:"deliveryRange"` // 如果DeliveryRangeType为DeliveryRangeTypePolygon则为逗号分隔坐标分号分隔的坐标点坐标与Lng和Lat一样都是整数比如 121361504,31189308;121420555,31150238。否则为半径单位为米
Status int `json:"status"`
AutoEnableAt *time.Time `orm:"type(datetime);null" json:"autoEnableAt"` // 自动营业时间(临时休息用)
ChangePriceType int8 `json:"changePriceType"` // 修改价格类型,即是否需要审核