|
|
@@ -1,6 +1,7 @@
|
|
|
package order_controller
|
|
|
|
|
|
import (
|
|
|
+ "fmt"
|
|
|
"fohow.com/apps"
|
|
|
"fohow.com/apps/models/order_model"
|
|
|
"fohow.com/apps/models/product_model"
|
|
|
@@ -45,6 +46,13 @@ func (self *OrderController) CreateCart() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //限购逻辑
|
|
|
+ if product.PurchaseLimitCount > 0 {
|
|
|
+ if product.PurchaseLimitCount < count {
|
|
|
+ self.ReturnError(403, []string{apps.OverLimitCount[0], fmt.Sprintf("该商品限购%d件", product.PurchaseLimitCount)}, "", nil)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
cart := new(order_model.Cart).Create(wxUId, uId, product.Id, count)
|
|
|
result := false
|
|
|
if cart != nil {
|