- 修复DeleteConfig中删除银行的BUG

This commit is contained in:
gazebo
2019-08-05 15:22:17 +08:00
parent a6ef8e4427
commit 044f5860b1

View File

@@ -241,9 +241,9 @@ func DeleteConfig(ctx *jxcontext.Context, key, configType string) (err error) {
if err = checkConfig(configType, key, ""); err != nil {
return err
}
db := dao.GetDB()
switch configType {
case model.ConfigTypePricePack:
db := dao.GetDB()
storeMapList, err := dao.GetStoresMapList(db, nil, nil, model.StoreStatusAll, model.StoreIsSyncYes, key)
if err != nil {
return err
@@ -255,11 +255,11 @@ func DeleteConfig(ctx *jxcontext.Context, key, configType string) (err error) {
}
return fmt.Errorf("还有门店在使用价格包:%s门店信息:%s", key, strings.Join(storeInfo, ","))
}
_, err = dao.DeleteEntityLogically(db, &model.NewConfig{}, nil, ctx.GetUserName(), map[string]interface{}{
"Key": key,
"Type": configType,
})
}
_, err = dao.DeleteEntityLogically(db, &model.NewConfig{}, nil, ctx.GetUserName(), map[string]interface{}{
"Key": key,
"Type": configType,
})
return err
}