Commit 849ba111 by 杨树贤

判断逻辑 修改

parent 7ce618a2
Showing with 11 additions and 11 deletions
...@@ -191,17 +191,6 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan ...@@ -191,17 +191,6 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
sku.AcType = 0 sku.AcType = 0
sku.AllowCoupon = 1 sku.AllowCoupon = 1
//最小起订量要大于阶梯价的最小阶梯数量
if len(sku.LadderPrice) > 0 {
//排序
sort.Sort(sorter.LadderPriceSorter(sku.LadderPrice))
//取出第一个阶梯价
purchases := sku.LadderPrice[0].Purchases
if purchases > sku.Moq {
sku.Moq = purchases
}
}
//这里获取活动价格和活动类型(折扣打折活动) //这里获取活动价格和活动类型(折扣打折活动)
sku = ls.GetActivity(sku) sku = ls.GetActivity(sku)
...@@ -274,6 +263,17 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan ...@@ -274,6 +263,17 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
} }
//最小起订量要大于阶梯价的最小阶梯数量
if len(sku.LadderPrice) > 0 {
//排序
sort.Sort(sorter.LadderPriceSorter(sku.LadderPrice))
//取出第一个阶梯价
purchases := sku.LadderPrice[0].Purchases
if purchases > sku.Moq {
sku.Moq = purchases
}
}
//处理是否可以购买 //处理是否可以购买
if sku.Mpq == 0 { if sku.Mpq == 0 {
sku.Mpq = 1 sku.Mpq = 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment