abiao před 4 roky
rodič
revize
d1844ee5eb

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

@@ -212,6 +212,19 @@ func (self *ProductController) GetPdDetail() {
 		Product *product_model.Product `json:"product"`
 	}
 	if pd != nil {
+		//获取颜色,规格名称
+		if sizeId > int64(0) {
+			prd_size := product_model.GetProductAttrValueById(sizeId)
+			if prd_size != nil {
+				pd.SizeName = prd_size.Name
+			}
+		}
+		if colorId > int64(0) {
+			prd_color := product_model.GetProductAttrValueById(colorId)
+			if prd_color != nil {
+				pd.ColorName = prd_color.Name
+			}
+		}
 		pd.SoldCount = pd.SaleNums
 		if pd.Count > pd.SoldCount {
 			pd.LeftCount = pd.Count - pd.SoldCount