创建活动折扣检查失败时,返回平台价

This commit is contained in:
gazebo
2019-11-20 09:12:27 +08:00
parent 56869ef22a
commit 61570289a2

View File

@@ -34,6 +34,7 @@ type ActStoreSkuParam struct {
model.ActStoreSku
ActualActPrice int64 `json:"actualActPrice,omitempty"` // 单品级活动用,创建活动时商品的活动价格
VendorPrice int64 `json:"vendorPrice,omitempty"` // 创建活动时的平台价格
ErrMsg string `json:"errMsg,omitempty"`
}
@@ -149,6 +150,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
jxPrice := storeSkuInfo.Price
actSkuMap.VendorPrice = int64(getVendorPriceFromStoreSkuBind(storeSkuInfo, vendorID))
v.OriginalPrice = int64(jxPrice)
v.OriginalPrice = actSkuMap.VendorPrice // 暂时返回平台价
}
var err2 error
if act.Type != model.ActSkuFake { // 非结算,要计算实际活动价格
@@ -176,6 +178,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
if err2 = checkDiscountValidation(act.Type, float64(actSkuMap.ActualActPrice)*100/float64(actSkuMap.VendorPrice)); err2 != nil {
v.ErrMsg = err2.Error()
v.ActualActPrice = actSkuMap.ActualActPrice
v.VendorPrice = actSkuMap.VendorPrice
wrongSkuList = append(wrongSkuList, v)
}
}