- ActStoreSkuParam2Model中当有wrongSkuList时,不覆盖OriginalPrice

This commit is contained in:
gazebo
2019-07-26 17:47:51 +08:00
parent 272f5651d8
commit 1a9beaa4f9

View File

@@ -148,7 +148,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
}
}
if err2 := checkDiscountValidation(act.Type, int(actSkuMap.ActualActPrice*100/actSkuMap.VendorPrice)); err2 != nil {
v.ErrMsg = fmt.Sprintf("err:%s, actPrice:%d, vendorPrice:%d, discount:%d", err2.Error(), actSkuMap.ActualActPrice, actSkuMap.VendorPrice, int(actSkuMap.ActualActPrice*100/actSkuMap.VendorPrice))
v.ErrMsg = err2.Error()
wrongSkuList = append(wrongSkuList, v)
} else {
dao.WrapAddIDCULDEntity(actSkuMap, ctx.GetUserName())
@@ -163,14 +163,16 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
err = nil
}
}
for _, v := range oneStoreSkuParam {
if validSkuMap[v.SkuID] == 1 { // todo 这里是否需要判断
if storeSkuInfo := storeSkuMap[jxutils.Combine2Int(v.StoreID, v.SkuID)]; storeSkuInfo != nil {
storeSku := &v.ActStoreSku
storeSku.ActID = act.ID
storeSku.OriginalPrice = int64(storeSkuInfo.Price)
dao.WrapAddIDCULDEntity(storeSku, ctx.GetUserName())
actStoreSkuList = append(actStoreSkuList, storeSku)
if len(wrongSkuList) == 0 {
for _, v := range oneStoreSkuParam {
if validSkuMap[v.SkuID] == 1 { // todo 这里是否需要判断
if storeSkuInfo := storeSkuMap[jxutils.Combine2Int(v.StoreID, v.SkuID)]; storeSkuInfo != nil {
storeSku := &v.ActStoreSku
storeSku.ActID = act.ID
storeSku.OriginalPrice = int64(storeSkuInfo.Price)
dao.WrapAddIDCULDEntity(storeSku, ctx.GetUserName())
actStoreSkuList = append(actStoreSkuList, storeSku)
}
}
}
}