This commit is contained in:
苏尹岚
2020-07-31 17:18:54 +08:00
parent c45ce8a678
commit 9ed5763c33

View File

@@ -2,6 +2,7 @@ package cms
import ( import (
"bytes" "bytes"
"encoding/json"
"errors" "errors"
"fmt" "fmt"
"io" "io"
@@ -3399,17 +3400,20 @@ func UpdateStorePricePack(ctx *jxcontext.Context, storeID, vendorID int, pricePa
}() }()
//证明是门店自己的调价包 //证明是门店自己的调价包
if strings.Contains(pricePack, utils.Int2Str(storeID)) { if strings.Contains(pricePack, utils.Int2Str(storeID)) {
configList, err := dao.QueryConfigs(db, pricePack, model.ConfigTypePricePack, "") obj := dao.PricePercentagePack2Obj(value)
if err != nil { realValue, _ := json.Marshal(obj)
dao.Rollback(db) _, err = UpdateConfig(ctx, pricePack, model.ConfigTypePricePack, string(realValue))
return err // configList, err := dao.QueryConfigs(db, pricePack, model.ConfigTypePricePack, "")
} // if err != nil {
if _, err = dao.UpdateEntityLogically(db, configList[0], map[string]interface{}{ // dao.Rollback(db)
"Value": value, // return err
}, ctx.GetUserName(), nil); err != nil { // }
dao.Rollback(db) // if _, err = dao.UpdateEntityLogically(db, configList[0], map[string]interface{}{
return err // "Value": value,
} // }, ctx.GetUserName(), nil); err != nil {
// dao.Rollback(db)
// return err
// }
} else { } else {
//表示门店要改他原有的调价包 //表示门店要改他原有的调价包
//1、调价包名字要加上门店编号门店名等 //1、调价包名字要加上门店编号门店名等