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