Merge remote-tracking branch 'origin/mark' into su
This commit is contained in:
@@ -146,8 +146,6 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
|
||||
storeSkuInfo := storeSkuMap[jxutils.Combine2Int(v.StoreID, v.SkuID)]
|
||||
if storeSkuInfo != nil {
|
||||
jxPrice := storeSkuInfo.Price
|
||||
// pricePercentage := jxutils.GetPricePercentage(storeDetail.PricePercentagePackObj, jxPrice, int(storeDetail.PricePercentage))
|
||||
// actSkuMap.VendorPrice = int64(jxutils.CaculateSkuVendorPrice(jxPrice, pricePercentage))
|
||||
actSkuMap.VendorPrice = int64(getVendorPriceFromStoreSkuBind(storeSkuInfo, vendorID))
|
||||
v.OriginalPrice = int64(jxPrice)
|
||||
}
|
||||
@@ -166,7 +164,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
|
||||
if v.PricePercentage != 0 {
|
||||
percentage = v.PricePercentage
|
||||
}
|
||||
actSkuMap.ActualActPrice = int64(jxutils.CaculateSkuVendorPrice(int(actSkuMap.VendorPrice), percentage))
|
||||
actSkuMap.ActualActPrice = int64(jxutils.CaculateSkuVendorPrice(int(actSkuMap.VendorPrice), percentage, 0))
|
||||
if actSkuMap.ActualActPrice > 10 {
|
||||
actSkuMap.ActualActPrice = int64(math.Floor(float64(actSkuMap.ActualActPrice)/10) * 10)
|
||||
}
|
||||
|
||||
@@ -1888,10 +1888,10 @@ func RefreshStoresSkuByVendor(ctx *jxcontext.Context, storeIDs []int, vendorID i
|
||||
}
|
||||
}
|
||||
for _, v := range storeSkuList {
|
||||
pricePercentage := jxutils.GetPricePercentageByVendorPrice(storeMap[v.StoreID].PricePercentagePackObj, v.Price, int(storeMap[v.StoreID].PricePercentage))
|
||||
pricePercentage, priceAdd := jxutils.GetPricePercentageByVendorPrice(storeMap[v.StoreID].PricePercentagePackObj, v.Price, int(storeMap[v.StoreID].PricePercentage))
|
||||
skuName := skuNameMap[skuMap[v.SkuID].NameID]
|
||||
v.Price = jxutils.CaculateSkuPriceFromVendor(v.Price, pricePercentage)
|
||||
v.UnitPrice = jxutils.CaculateSkuPriceFromVendor(skuName.Price, pricePercentage)
|
||||
v.Price = jxutils.CaculateSkuPriceFromVendor(v.Price, pricePercentage, priceAdd)
|
||||
v.UnitPrice = jxutils.CaculateSkuPriceFromVendor(skuName.Price, pricePercentage, priceAdd)
|
||||
dao.WrapAddIDCULDEntity(v, ctx.GetUserName())
|
||||
setStoreSkuBindStatus(v, model.SyncFlagNewMask)
|
||||
v.JdSyncStatus = 0
|
||||
|
||||
@@ -213,8 +213,8 @@ func storeSkuSyncInfo2Bare(inSku *dao.StoreSkuSyncInfo) (outSku *partner.StoreSk
|
||||
|
||||
func calVendorPrice4StoreSku(inSku *dao.StoreSkuSyncInfo, pricePercentagePack model.PricePercentagePack, pricePercentage int) (outSku *dao.StoreSkuSyncInfo) {
|
||||
if inSku.VendorPrice <= 0 { // 避免重新计算
|
||||
pricePercentage = jxutils.GetPricePercentage(pricePercentagePack, int(inSku.Price), pricePercentage)
|
||||
inSku.VendorPrice = int64(jxutils.CaculateSkuVendorPrice(int(inSku.Price), pricePercentage))
|
||||
pricePercentage2, priceAdd2 := jxutils.GetPricePercentage(pricePercentagePack, int(inSku.Price), pricePercentage)
|
||||
inSku.VendorPrice = int64(jxutils.CaculateSkuVendorPrice(int(inSku.Price), pricePercentage2, priceAdd2))
|
||||
if inSku.VendorPrice <= 0 {
|
||||
inSku.VendorPrice = 1 // 最少1分钱
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user