|
|
@@ -302,7 +302,7 @@ func (self *ProductController) GetProductSizesByPid() {
|
|
|
|
|
|
ret := &Ret{}
|
|
|
if product != nil {
|
|
|
- list := product_model.GetProductConfigAttrsByPId(pId)
|
|
|
+ list := product_model.GetProductConfigAttrsByPId(product.RelateProductId)
|
|
|
for _, item := range list {
|
|
|
attrTypeList := []*product_model.ProductAttr{}
|
|
|
productKeyConfig := product_model.GetProductAttrKey(item.AttrKeyId)
|
|
|
@@ -311,9 +311,10 @@ func (self *ProductController) GetProductSizesByPid() {
|
|
|
attrList := product_model.GetProductAttrsByKId(productKeyConfig.Id)
|
|
|
for _, attr := range attrList {
|
|
|
prod := product_model.GetProductByIdAndSizeId(product.RelateProductId, attr.Id, true)
|
|
|
- if prod != nil {
|
|
|
- attrTypeList = append(attrTypeList, attr)
|
|
|
+ if prod == nil {
|
|
|
+ continue
|
|
|
}
|
|
|
+ attrTypeList = append(attrTypeList, attr)
|
|
|
}
|
|
|
productKeyConfig.ProductAttr = attrTypeList
|
|
|
ret.Size = productKeyConfig
|