Browse Source

add clear product cache

abiao 4 years ago
parent
commit
c86337b24c

+ 1 - 0
go/gopath/src/fohow.com/apps/controllers/order_controller/cart_controller.go

@@ -240,6 +240,7 @@ func (self *OrderController) GetCartList() {
 				item.ColorName = productColor.Name
 			}
 		}
+		item.Package = product.Package
 		if product.Package {
 			cart_package := &order_model.ProductItem{}
 			packageList := product_model.GetPackageList(product.Id, true)

+ 4 - 2
go/gopath/src/fohow.com/apps/models/order_model/cart.go

@@ -24,14 +24,16 @@ type Cart struct {
 	WxUserId      int64          `orm:"column(wx_user_id)"                                  json:"wx_user_id"`
 	CreatedAt     time.Time      `orm:"column(created_at);null;auto_now_add;type(datetime)" json:"-"`    // datetime
 	Count         int64          `orm:"column(nums)"                                       json:"count"` // int(11)
-	IsBuy         bool           `orm:"column(is_buy)" 			json:"is_under_seckill"`
+	IsBuy         bool           `orm:"column(is_buy)" json:"is_under_seckill"`
 	ProductName   string         `orm:"-"     json:"product_name"`   // decimal(10,2)
 	SizeName      string         `orm:"-"     json:"size_name"`      //   varchar(64)
 	ColorName     string         `orm:"-"     json:"color_name"`     //  varchar(64)
 	Cover         string         `orm:"-"     json:"cover"`          // decimal(10,2)
 	OriginalPrice int64          `orm:"-"     json:"original_price"` // decimal(10,2)
 	Attrs         string         `orm:"-"     json:"attrs"`          // decimal(10,2)
-	PackageList   []*ProductItem `orm:"-"     json:"package_list"`   // varchar(255)
+	Package       bool           `orm:"-"     json:"package"`
+	PackageList   []*ProductItem `orm:"-"     json:"package_list"` // varchar(255)
+
 }
 
 func (self *Cart) TableName() string {