|
@@ -329,7 +329,7 @@ func GetProductByIdAndSizeAndColor(id, sizeId, colorId int64, useCache bool) *Pr
|
|
|
|
|
|
|
|
//根据商品 relate_Id 跟 sizeId,获取商品信息
|
|
//根据商品 relate_Id 跟 sizeId,获取商品信息
|
|
|
func GetProductByIdAndSizeId(relateId, sizeId int64, useCache bool) *Product {
|
|
func GetProductByIdAndSizeId(relateId, sizeId int64, useCache bool) *Product {
|
|
|
- k := fmt.Sprintf("product_model.GetProductByIdAndSizeId[%d]", relateId)
|
|
|
|
|
|
|
+ k := fmt.Sprintf("product_model.GetProductByRelateId[%d]SizeId[%d]", relateId, sizeId)
|
|
|
if useCache {
|
|
if useCache {
|
|
|
if v, ok := cache.Cache.Get(k).(*Product); ok {
|
|
if v, ok := cache.Cache.Get(k).(*Product); ok {
|
|
|
return v
|
|
return v
|
|
@@ -348,7 +348,7 @@ func GetProductByIdAndSizeId(relateId, sizeId int64, useCache bool) *Product {
|
|
|
|
|
|
|
|
//根据商品 relate_Id 跟 colorId,获取商品信息
|
|
//根据商品 relate_Id 跟 colorId,获取商品信息
|
|
|
func GetProductByIdAndColorId(relateId, colorId int64, useCache bool) *Product {
|
|
func GetProductByIdAndColorId(relateId, colorId int64, useCache bool) *Product {
|
|
|
- k := fmt.Sprintf("product_model.GetProductByIdAndColorId[%d]", relateId)
|
|
|
|
|
|
|
+ k := fmt.Sprintf("product_model.GetProductByRelateId[%d]ColorId[%d]", relateId, colorId)
|
|
|
if useCache {
|
|
if useCache {
|
|
|
if v, ok := cache.Cache.Get(k).(*Product); ok {
|
|
if v, ok := cache.Cache.Get(k).(*Product); ok {
|
|
|
return v
|
|
return v
|