|
|
@@ -318,7 +318,7 @@ func (self *OrderController) MultipleCreate() {
|
|
|
}
|
|
|
order.Save()
|
|
|
//购物册清理
|
|
|
- ClearCart(order.WxUserId, order.OrderId)
|
|
|
+ //ClearCart(order.WxUserId, order.OrderId)
|
|
|
|
|
|
//发放赠品
|
|
|
helpers.SetOrderPromotionPro(order.OrderId, wxUser.Id)
|
|
|
@@ -521,28 +521,6 @@ func (self *OrderController) MultCentCreate() {
|
|
|
self.ServeJSON()
|
|
|
}
|
|
|
|
|
|
-func ClearCart(wxUserId int64, orderId string) {
|
|
|
- orderDetails := order_model.GetAllDetailsOrderId(orderId, false)
|
|
|
- for _, item := range orderDetails {
|
|
|
- cartItem := order_model.GetCartByWxUidAndPid(wxUserId, item.ProductId)
|
|
|
- if cartItem != nil {
|
|
|
- cartItem.Delete()
|
|
|
- }
|
|
|
- }
|
|
|
- //清除过期的秒杀商品项
|
|
|
- list := order_model.GetCartItemsByWxUserId(wxUserId)
|
|
|
- for _, item := range list {
|
|
|
- product := product_model.GetProductById(item.ProductId, true)
|
|
|
- if product != nil {
|
|
|
- if product.SeckilShowPrice > 0 && product.SeckillEnd.Unix() < time.Now().Unix() {
|
|
|
- cartItem := order_model.GetCartByWxUidAndPid(wxUserId, item.ProductId)
|
|
|
- cartItem.Delete()
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
// 获取用户订单详情
|
|
|
func (self *OrderController) Detail() {
|
|
|
|