|
|
@@ -346,7 +346,7 @@ func GetProductByIdAndSizeId(relateId, sizeId int64, useCache bool) *Product {
|
|
|
}
|
|
|
|
|
|
//根据商品 relate_Id 跟 colorId,获取商品信息
|
|
|
-func GetProductByIdAndColorId(relateId, sizeId int64, useCache bool) *Product {
|
|
|
+func GetProductByIdAndColorId(relateId, colorId int64, useCache bool) *Product {
|
|
|
k := fmt.Sprintf("product_model.GetProductByIdAndColorId[%d]", relateId)
|
|
|
if useCache {
|
|
|
if v, ok := cache.Cache.Get(k).(*Product); ok {
|
|
|
@@ -355,7 +355,7 @@ func GetProductByIdAndColorId(relateId, sizeId int64, useCache bool) *Product {
|
|
|
}
|
|
|
item := new(Product)
|
|
|
o := orm.NewOrm()
|
|
|
- if err := o.QueryTable(item).Filter("relate_product_id", relateId).Filter("color_id", sizeId).One(item); err != nil {
|
|
|
+ if err := o.QueryTable(item).Filter("relate_product_id", relateId).Filter("color_id", colorId).One(item); err != nil {
|
|
|
return nil
|
|
|
}
|
|
|
item.Cover = GetCoverByPId(relateId, useCache)
|