Przeglądaj źródła

商品规格更改返回

abiao 5 lat temu
rodzic
commit
f8ca39cf5e

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

@@ -312,8 +312,8 @@ func (self *ProductController) GetProductSizesByPid() {
 				if item.SizeType == product_model.SIZE_TYPE_1 {
 					attrList := product_model.GetProductAttrsByKId(productKeyConfig.Id)
 					for _, attr := range attrList {
-						prod := product_model.GetProductByIdAndSizeId(product.RelateProductId, attr.Id, false)
-						if prod != nil {
+						prodSize := product_model.GetProductByIdAndSizeId(product.RelateProductId, attr.Id, false)
+						if prodSize != nil {
 							size := &product_model.ProductAttr{}
 							size.Id = attr.Id
 							beego.BeeLogger.Warn("size_id --- %d", size.Id)
@@ -326,8 +326,8 @@ func (self *ProductController) GetProductSizesByPid() {
 				if item.SizeType == product_model.SIZE_TYPE_2 {
 					attrList := product_model.GetProductAttrsByKId(productKeyConfig.Id)
 					for _, attr := range attrList {
-						prod := product_model.GetProductByIdAndColorId(product.RelateProductId, attr.Id, false)
-						if prod != nil {
+						prodColor := product_model.GetProductByIdAndColorId(product.RelateProductId, attr.Id, false)
+						if prodColor != nil {
 							size := &product_model.ProductAttr{}
 							size.Id = attr.Id
 							beego.BeeLogger.Warn("color_id --- %d", size.Id)

+ 1 - 0
go/gopath/src/fohow.com/apps/models/product_model/product.go

@@ -342,6 +342,7 @@ func GetProductByIdAndSizeId(relateId, sizeId int64, useCache bool) *Product {
 	if err := o.QueryTable(item).Filter("relate_product_id", relateId).Filter("size_id", sizeId).One(item); err != nil {
 		return nil
 	}
+	beego.BeeLogger.Warn("1--size_id --- %d 2---size_id --- %d", relateId, sizeId)
 
 	return item
 }