Store添加字段AutoEnableAt
This commit is contained in:
@@ -649,8 +649,22 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
|
||||
break
|
||||
}
|
||||
}
|
||||
status := 0
|
||||
if valid["status"] != nil {
|
||||
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 {
|
||||
@@ -678,7 +692,7 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
|
||||
dummy := &model.StoreMap{}
|
||||
kv := make(map[string]interface{})
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user