- ActStoreSkuParam2Model中当有wrongSkuList时,不覆盖OriginalPrice
This commit is contained in:
@@ -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 {
|
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)
|
wrongSkuList = append(wrongSkuList, v)
|
||||||
} else {
|
} else {
|
||||||
dao.WrapAddIDCULDEntity(actSkuMap, ctx.GetUserName())
|
dao.WrapAddIDCULDEntity(actSkuMap, ctx.GetUserName())
|
||||||
@@ -163,14 +163,16 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
|
|||||||
err = nil
|
err = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, v := range oneStoreSkuParam {
|
if len(wrongSkuList) == 0 {
|
||||||
if validSkuMap[v.SkuID] == 1 { // todo 这里是否需要判断
|
for _, v := range oneStoreSkuParam {
|
||||||
if storeSkuInfo := storeSkuMap[jxutils.Combine2Int(v.StoreID, v.SkuID)]; storeSkuInfo != nil {
|
if validSkuMap[v.SkuID] == 1 { // todo 这里是否需要判断
|
||||||
storeSku := &v.ActStoreSku
|
if storeSkuInfo := storeSkuMap[jxutils.Combine2Int(v.StoreID, v.SkuID)]; storeSkuInfo != nil {
|
||||||
storeSku.ActID = act.ID
|
storeSku := &v.ActStoreSku
|
||||||
storeSku.OriginalPrice = int64(storeSkuInfo.Price)
|
storeSku.ActID = act.ID
|
||||||
dao.WrapAddIDCULDEntity(storeSku, ctx.GetUserName())
|
storeSku.OriginalPrice = int64(storeSkuInfo.Price)
|
||||||
actStoreSkuList = append(actStoreSkuList, storeSku)
|
dao.WrapAddIDCULDEntity(storeSku, ctx.GetUserName())
|
||||||
|
actStoreSkuList = append(actStoreSkuList, storeSku)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user