|
|
@@ -52,11 +52,16 @@ func (self *OrderController) Create() {
|
|
|
//if user.IsBlackUser == 1 {
|
|
|
// self.ReturnError(403, apps.AccountError, "", nil)
|
|
|
//}
|
|
|
+ //店铺专区下单
|
|
|
+ if product.Ptype != product_model.TYPE_DIRECT_SALE {
|
|
|
+ self.ReturnError(403, apps.ProductErrorType, "", 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)
|
|
|
@@ -189,6 +194,10 @@ func (self *OrderController) MultipleCreate() {
|
|
|
if product == nil {
|
|
|
self.ReturnError(403, apps.NoExist, "", nil)
|
|
|
}
|
|
|
+ //专区下单判断
|
|
|
+ if product.Ptype != product_model.TYPE_DIRECT_SALE {
|
|
|
+ self.ReturnError(403, apps.ProductErrorType, "", nil)
|
|
|
+ }
|
|
|
if product.SinglePurchLimit > 0 {
|
|
|
if product.SinglePurchLimit < cNums {
|
|
|
self.ReturnError(403, []string{apps.SingleOverLimitCount[0], fmt.Sprintf("%s商品单次限购%d件", product.Name, product.SinglePurchLimit)}, "", nil)
|