|
|
@@ -52,7 +52,11 @@ func (self *OrderController) Create() {
|
|
|
//if user.IsBlackUser == 1 {
|
|
|
// self.ReturnError(403, apps.AccountError, "", nil)
|
|
|
//}
|
|
|
-
|
|
|
+ if product.SinglePurchLimit > 0 {
|
|
|
+ if product.SinglePurchLimit < count {
|
|
|
+ self.ReturnError(403, []string{apps.SingleOverLimitCount[0], fmt.Sprintf("该商品单次限购%d件", product.SinglePurchLimit)}, "", nil)
|
|
|
+ }
|
|
|
+ }
|
|
|
if product.PurchaseLimitCount > 0 {
|
|
|
if product.PurchaseLimitCount < count {
|
|
|
self.ReturnError(403, []string{apps.OverLimitCount[0], fmt.Sprintf("该商品限购%d件", product.PurchaseLimitCount)}, "", nil)
|
|
|
@@ -184,7 +188,11 @@ func (self *OrderController) MultipleCreate() {
|
|
|
if product == nil {
|
|
|
self.ReturnError(403, apps.NoExist, "", nil)
|
|
|
}
|
|
|
-
|
|
|
+ if product.SinglePurchLimit > 0 {
|
|
|
+ if product.SinglePurchLimit < cNums {
|
|
|
+ self.ReturnError(403, []string{apps.SingleOverLimitCount[0], fmt.Sprintf("该商品单次限购%d件", product.SinglePurchLimit)}, "", nil)
|
|
|
+ }
|
|
|
+ }
|
|
|
if product.PurchaseLimitCount > 0 {
|
|
|
if product.PurchaseLimitCount < cNums {
|
|
|
self.ReturnError(403, []string{apps.OverLimitCount[0], fmt.Sprintf("%s商品限购%d件", product.Name, product.PurchaseLimitCount)}, "", nil)
|
|
|
@@ -202,6 +210,7 @@ func (self *OrderController) MultipleCreate() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//创建订单
|
|
|
order := new(order_model.Order).CreateNew(wxUId, uId,
|
|
|
totalPrice, int64(0), order_model.ORDER_TYPE_NORMAL, wxUser.Depart, order_model.SOURCE_XCX)
|
|
|
@@ -282,6 +291,11 @@ func (self *OrderController) MultShopCreate() {
|
|
|
if product.Ptype != product_model.SHOP_SALE {
|
|
|
self.ReturnError(403, apps.NoShopSale, "", nil)
|
|
|
}
|
|
|
+ if product.SinglePurchLimit > 0 {
|
|
|
+ if product.SinglePurchLimit < cNums {
|
|
|
+ self.ReturnError(403, []string{apps.SingleOverLimitCount[0], fmt.Sprintf("该商品单次限购%d件", product.SinglePurchLimit)}, "", nil)
|
|
|
+ }
|
|
|
+ }
|
|
|
//商品限购判断
|
|
|
if product.PurchaseLimitCount > 0 {
|
|
|
if product.PurchaseLimitCount < cNums {
|
|
|
@@ -351,6 +365,11 @@ func (self *OrderController) MultCentCreate() {
|
|
|
if product.Ptype != product_model.CENT_SALE {
|
|
|
self.ReturnError(403, apps.NoShopSale, "", nil)
|
|
|
}
|
|
|
+ if product.SinglePurchLimit > 0 {
|
|
|
+ if product.SinglePurchLimit < cNums {
|
|
|
+ self.ReturnError(403, []string{apps.SingleOverLimitCount[0], fmt.Sprintf("该商品单次限购%d件", product.SinglePurchLimit)}, "", nil)
|
|
|
+ }
|
|
|
+ }
|
|
|
//商品限购判断
|
|
|
if product.PurchaseLimitCount > 0 {
|
|
|
if product.PurchaseLimitCount < cNums {
|