This commit is contained in:
gazebo
2019-06-20 11:33:49 +08:00
parent ae9833361a
commit 5adafac669
2 changed files with 63 additions and 61 deletions

View File

@@ -352,7 +352,7 @@ func caculateOrderEarningPrice(order *model.GoodsOrder, storePayPercentage int)
if skuEarningPrice == 0 { if skuEarningPrice == 0 {
skuEarningPrice = jxutils.CaculateSkuEarningPrice(v.ShopPrice, v.SalePrice, storePayPercentage) skuEarningPrice = jxutils.CaculateSkuEarningPrice(v.ShopPrice, v.SalePrice, storePayPercentage)
} }
order.EarningPrice += skuEarningPrice order.EarningPrice += skuEarningPrice * int64(v.Count)
} }
} }

View File

@@ -298,10 +298,11 @@ func CreateJdPromotion(ctx *jxcontext.Context, vendorID int, isIDJd bool, isAsyn
return "", err return "", err
} }
if len(conflictPromotion) > 0 { if len(conflictPromotion) > 0 {
return "", fmt.Errorf("有冲突配置:%s", utils.Format4Output(conflictPromotion, true)) return "", fmt.Errorf("有冲突配置:%s", utils.Format4Output(conflictPromotion, false))
} }
} }
if vendorPromotionID == "" && vendorID == model.VendorIDJD { if vendorPromotionID == "" {
if vendorID == model.VendorIDJD {
sql := ` sql := `
SELECT t1.*, t2.jd_id, t3.vendor_store_id SELECT t1.*, t2.jd_id, t3.vendor_store_id
FROM store_sku_bind t1 FROM store_sku_bind t1
@@ -372,6 +373,7 @@ func CreateJdPromotion(ctx *jxcontext.Context, vendorID int, isIDJd bool, isAsyn
if len(promotionPrices) == 0 { if len(promotionPrices) == 0 {
return "", ErrEmptySkus return "", ErrEmptySkus
} }
}
} else { } else {
promotion.VendorPromotionID = vendorPromotionID promotion.VendorPromotionID = vendorPromotionID
promotion.CreateType = model.PromotionCreateTypeByVendor promotion.CreateType = model.PromotionCreateTypeByVendor
@@ -665,7 +667,7 @@ func CancelJdPromotion(ctx *jxcontext.Context, promotionID int) (err error) {
if err = dao.GetEntity(db, promotion); err != nil { if err = dao.GetEntity(db, promotion); err != nil {
return err return err
} }
if promotion.Status != model.PromotionStatusCanceled { if promotion.Status == model.PromotionStatusCanceled {
return errors.New("当前状态已经是取消") return errors.New("当前状态已经是取消")
} }
if promotion.Status == model.PromotionStatusRemoteCreated { if promotion.Status == model.PromotionStatusRemoteCreated {