abiao лет назад: 3
Родитель
Сommit
aa0a0df875

+ 6 - 5
go/gopath/src/fohow.com/apps/controllers/order_controller/cart_controller.go

@@ -243,11 +243,7 @@ func (self *OrderController) GetCartList() {
 				item.ColorName = productColor.Name
 			}
 		}
-		//获取专区名称
-		saleType := product_model.GetProductSaleTypeById(product.SaleZone)
-		if saleType != nil {
-			product.SaleZoneName = saleType.Name
-		}
+
 		item.Package = product.Package
 		if product.Package {
 			packageList := product_model.GetPackageList(product.Id, true)
@@ -260,6 +256,11 @@ func (self *OrderController) GetCartList() {
 				item.PackageList = append(item.PackageList, cart_package)
 			}
 		}
+		//获取专区名称
+		saleType := product_model.GetProductSaleTypeById(product.SaleZone)
+		if saleType != nil {
+			item.SaleZoneName = saleType.Name
+		}
 		item.SeckillStartAt = product.SeckillStart.Unix()
 		item.SeckillEndAt = product.SeckillEnd.Unix()
 		item.SeckilShowPrice = product.SeckilShowPrice

+ 7 - 0
go/gopath/src/fohow.com/apps/controllers/product_controller/product_controller.go

@@ -153,6 +153,13 @@ func (self *ProductController) Get() {
 	if pd.Count > pd.SoldCount {
 		pd.LeftCount = pd.Count - pd.SoldCount
 	}
+
+	//获取专区名称
+	saleType := product_model.GetProductSaleTypeById(pd.SaleZone)
+	if saleType != nil {
+		pd.SaleZoneName = saleType.Name
+	}
+
 	//pd.SoldCount = pd.SoldCount + pd.VirtualSoldCount
 	pd.SoldCount = product_model.GetProductCountByRelateId(pd.RelateProductId, true)
 

+ 10 - 9
go/gopath/src/fohow.com/apps/models/order_model/cart.go

@@ -25,15 +25,16 @@ type Cart struct {
 	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"`
-	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)
-	SeckillStartAt  int64          `orm:"-"     json:"seckill_start"`      // datetime
-	SeckillEndAt    int64          `orm:"-"     json:"seckill_end"`        // datetime
-	SeckilShowPrice int64          `orm:"-"     json:"seckill_show_price"` // datetime
+	ProductName     string         `orm:"-"     json:"product_name"`                            // decimal(10,2)
+	SaleZoneName    string         `orm:"-"                              json:"sale_zone_name"` // 销售区名称
+	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)
+	SeckillStartAt  int64          `orm:"-"     json:"seckill_start"`                           // datetime
+	SeckillEndAt    int64          `orm:"-"     json:"seckill_end"`                             // datetime
+	SeckilShowPrice int64          `orm:"-"     json:"seckill_show_price"`                      // datetime
 	Package         bool           `orm:"-"     json:"package"`
 	UseQuan         bool           `orm:"-"     json:"use_quan"`
 	Pv              int64          `orm:"-"     json:"pv"`           // pv