Store添加字段AutoEnableAt
This commit is contained in:
@@ -649,8 +649,22 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
status := 0
|
||||||
if valid["status"] != nil {
|
if valid["status"] != nil {
|
||||||
syncStatus |= model.SyncFlagStoreStatus
|
syncStatus |= model.SyncFlagStoreStatus
|
||||||
|
|
||||||
|
status = int(utils.Interface2Int64WithDefault(valid["status"], 0))
|
||||||
|
if status != model.StoreStatusClosed && status != model.StoreStatusHaveRest {
|
||||||
|
valid["autoEnableAt"] = nil
|
||||||
|
} else {
|
||||||
|
if valid["autoEnableAt"] != nil {
|
||||||
|
status = model.StoreStatusHaveRest
|
||||||
|
valid["autoEnableAt"] = utils.Time2Date(utils.Str2Time(utils.Interface2String(valid["autoEnableAt"])))
|
||||||
|
} else {
|
||||||
|
status = model.StoreStatusClosed
|
||||||
|
}
|
||||||
|
valid["status"] = status
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if valid["deliveryRange"] != nil {
|
if valid["deliveryRange"] != nil {
|
||||||
@@ -678,7 +692,7 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
|
|||||||
dummy := &model.StoreMap{}
|
dummy := &model.StoreMap{}
|
||||||
kv := make(map[string]interface{})
|
kv := make(map[string]interface{})
|
||||||
if valid["status"] != nil {
|
if valid["status"] != nil {
|
||||||
if status := int(utils.Interface2Int64WithDefault(valid["status"], 0)); status == model.StoreStatusOpened {
|
if syncStatus&model.SyncFlagStoreStatus != 0 && status == model.StoreStatusOpened {
|
||||||
kv[model.FieldStatus] = status
|
kv[model.FieldStatus] = status
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -253,6 +253,7 @@ type Store struct {
|
|||||||
DeliveryRangeType int8 `json:"deliveryRangeType"` // 参见相关常量定义
|
DeliveryRangeType int8 `json:"deliveryRangeType"` // 参见相关常量定义
|
||||||
DeliveryRange string `orm:"type(text)" json:"deliveryRange"` // 如果DeliveryRangeType为DeliveryRangeTypePolygon,则为逗号分隔坐标,分号分隔的坐标点(坐标与Lng和Lat一样,都是整数),比如 121361504,31189308;121420555,31150238。否则为半径,单位为米
|
DeliveryRange string `orm:"type(text)" json:"deliveryRange"` // 如果DeliveryRangeType为DeliveryRangeTypePolygon,则为逗号分隔坐标,分号分隔的坐标点(坐标与Lng和Lat一样,都是整数),比如 121361504,31189308;121420555,31150238。否则为半径,单位为米
|
||||||
Status int `json:"status"`
|
Status int `json:"status"`
|
||||||
|
AutoEnableAt *time.Time `orm:"type(datetime);null" json:"autoEnableAt"` // 自动营业时间(临时休息用)
|
||||||
ChangePriceType int8 `json:"changePriceType"` // 修改价格类型,即是否需要审核
|
ChangePriceType int8 `json:"changePriceType"` // 修改价格类型,即是否需要审核
|
||||||
SMSNotify int8 `orm:"column(sms_notify);" json:"smsNotify"` // 是否通过短信接收订单消息
|
SMSNotify int8 `orm:"column(sms_notify);" json:"smsNotify"` // 是否通过短信接收订单消息
|
||||||
PrinterDisabled int8 `orm:"default(0)" json:"printerDisabled"` // 是否禁用网络打印机
|
PrinterDisabled int8 `orm:"default(0)" json:"printerDisabled"` // 是否禁用网络打印机
|
||||||
|
|||||||
Reference in New Issue
Block a user