瀏覽代碼

商品规格更改返回

abiao 5 年之前
父節點
當前提交
ae41671562
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. 4 5
      go/gopath/src/fohow.com/apps/controllers/product_controller/product_controller.go

+ 4 - 5
go/gopath/src/fohow.com/apps/controllers/product_controller/product_controller.go

@@ -304,7 +304,7 @@ func (self *ProductController) GetProductSizesByPid() {
 	if product != nil {
 		list := product_model.GetProductConfigAttrsByPId(product.RelateProductId)
 		for _, item := range list {
-			attrTypeList := []*product_model.ProductAttr{}
+
 			productKeyConfig := product_model.GetProductAttrKey(item.AttrKeyId)
 			if productKeyConfig != nil {
 				if item.SizeType == product_model.SIZE_TYPE_1 {
@@ -314,9 +314,8 @@ func (self *ProductController) GetProductSizesByPid() {
 						if prod == nil {
 							continue
 						}
-						attrTypeList = append(attrTypeList, attr)
+						productKeyConfig.ProductAttr = append(productKeyConfig.ProductAttr, attr)
 					}
-					productKeyConfig.ProductAttr = attrTypeList
 					ret.Size = productKeyConfig
 				}
 				if item.SizeType == product_model.SIZE_TYPE_2 {
@@ -326,9 +325,9 @@ func (self *ProductController) GetProductSizesByPid() {
 						if prod == nil {
 							continue
 						}
-						attrTypeList = append(attrTypeList, attr)
+						productKeyConfig.ProductAttr = append(productKeyConfig.ProductAttr, attr)
+
 					}
-					productKeyConfig.ProductAttr = attrTypeList
 					ret.Color = productKeyConfig
 				}
 			}