|
|
@@ -191,17 +191,17 @@ func (self *OrderController) MultipleCreate() {
|
|
|
|
|
|
if product.PurchaseLimitCount > 0 {
|
|
|
if product.PurchaseLimitCount < cNums {
|
|
|
- self.ReturnError(403, []string{apps.OverLimitCount[0], fmt.Sprintf("该商品限购%d件", product.PurchaseLimitCount)}, "", nil)
|
|
|
+ self.ReturnError(403, []string{apps.OverLimitCount[0], fmt.Sprintf("%s商品限购%d件", product.Name, product.PurchaseLimitCount)}, "", nil)
|
|
|
} else {
|
|
|
purchaseTotalCount := order_model.GetOrderCountByPIdAndWxUId(cartItem.ProductId, wxUId)
|
|
|
//历史已经买够到限购数量了
|
|
|
if product.PurchaseLimitCount <= purchaseTotalCount {
|
|
|
- self.ReturnError(403, []string{apps.PurchasedReachLimit[0], fmt.Sprintf("该商品限购%d件", product.PurchaseLimitCount)}, "", nil)
|
|
|
+ self.ReturnError(403, []string{apps.PurchasedReachLimit[0], fmt.Sprintf("%s商品限购%d件", product.Name, product.PurchaseLimitCount)}, "", nil)
|
|
|
}
|
|
|
//历史没买够数量,但是历史总数+想购买的数量 超过限购数量
|
|
|
if product.PurchaseLimitCount < (purchaseTotalCount + cNums) {
|
|
|
canBuyCount := product.PurchaseLimitCount - purchaseTotalCount
|
|
|
- self.ReturnError(403, []string{apps.PurchasedReachLimit[0], fmt.Sprintf("您还可以购买%d件", canBuyCount)}, "", nil)
|
|
|
+ self.ReturnError(403, []string{apps.PurchasedReachLimit[0], fmt.Sprintf("%s您还可以购买%d件", product.Name, canBuyCount)}, "", nil)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -266,17 +266,17 @@ func (self *OrderController) MultShopCreate() {
|
|
|
//商品限购判断
|
|
|
if product.PurchaseLimitCount > 0 {
|
|
|
if product.PurchaseLimitCount < cNums {
|
|
|
- self.ReturnError(403, []string{apps.OverLimitCount[0], fmt.Sprintf("该商品限购%d件", product.PurchaseLimitCount)}, "", nil)
|
|
|
+ self.ReturnError(403, []string{apps.OverLimitCount[0], fmt.Sprintf("%s商品限购%d件", product.Name, product.PurchaseLimitCount)}, "", nil)
|
|
|
} else {
|
|
|
purchaseTotalCount := order_model.GetOrderCountByPIdAndWxUId(pId, wxUId)
|
|
|
//历史已经买够到限购数量了
|
|
|
if product.PurchaseLimitCount <= purchaseTotalCount {
|
|
|
- self.ReturnError(403, []string{apps.PurchasedReachLimit[0], fmt.Sprintf("该商品限购%d件", product.PurchaseLimitCount)}, "", nil)
|
|
|
+ self.ReturnError(403, []string{apps.PurchasedReachLimit[0], fmt.Sprintf("%s商品限购%d件", product.Name, product.PurchaseLimitCount)}, "", nil)
|
|
|
}
|
|
|
//历史没买够数量,但是历史总数+想购买的数量 超过限购数量
|
|
|
if product.PurchaseLimitCount < (purchaseTotalCount + cNums) {
|
|
|
canBuyCount := product.PurchaseLimitCount - purchaseTotalCount
|
|
|
- self.ReturnError(403, []string{apps.PurchasedReachLimit[0], fmt.Sprintf("您还可以购买%d件", canBuyCount)}, "", nil)
|
|
|
+ self.ReturnError(403, []string{apps.PurchasedReachLimit[0], fmt.Sprintf("%s您还可以购买%d件", product.Name, canBuyCount)}, "", nil)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -335,17 +335,17 @@ func (self *OrderController) MultCentCreate() {
|
|
|
//商品限购判断
|
|
|
if product.PurchaseLimitCount > 0 {
|
|
|
if product.PurchaseLimitCount < cNums {
|
|
|
- self.ReturnError(403, []string{apps.OverLimitCount[0], fmt.Sprintf("该商品限购%d件", product.PurchaseLimitCount)}, "", nil)
|
|
|
+ self.ReturnError(403, []string{apps.OverLimitCount[0], fmt.Sprintf("%s商品限购%d件", product.Name, product.PurchaseLimitCount)}, "", nil)
|
|
|
} else {
|
|
|
purchaseTotalCount := order_model.GetOrderCountByPIdAndWxUId(pId, wxUId)
|
|
|
//历史已经买够到限购数量了
|
|
|
if product.PurchaseLimitCount <= purchaseTotalCount {
|
|
|
- self.ReturnError(403, []string{apps.PurchasedReachLimit[0], fmt.Sprintf("该商品限购%d件", product.PurchaseLimitCount)}, "", nil)
|
|
|
+ self.ReturnError(403, []string{apps.PurchasedReachLimit[0], fmt.Sprintf("%s商品限购%d件", product.Name, product.PurchaseLimitCount)}, "", nil)
|
|
|
}
|
|
|
//历史没买够数量,但是历史总数+想购买的数量 超过限购数量
|
|
|
if product.PurchaseLimitCount < (purchaseTotalCount + cNums) {
|
|
|
canBuyCount := product.PurchaseLimitCount - purchaseTotalCount
|
|
|
- self.ReturnError(403, []string{apps.PurchasedReachLimit[0], fmt.Sprintf("您还可以购买%d件", canBuyCount)}, "", nil)
|
|
|
+ self.ReturnError(403, []string{apps.PurchasedReachLimit[0], fmt.Sprintf("%s您还可以购买%d件", product.Name, canBuyCount)}, "", nil)
|
|
|
}
|
|
|
}
|
|
|
}
|