|
@@ -41,7 +41,14 @@ A:
|
|
|
commodityAreaIds = append(commodityAreaIds, sku.CommodityAreaId)
|
|
commodityAreaIds = append(commodityAreaIds, sku.CommodityAreaId)
|
|
|
commodityAreaIdsString = fmt.Sprint(commodityAreaIdsString, ",", sku.CommodityAreaId)
|
|
commodityAreaIdsString = fmt.Sprint(commodityAreaIdsString, ",", sku.CommodityAreaId)
|
|
|
}
|
|
}
|
|
|
- commodityAreaIdsString = commodityAreaIdsString[1:]
|
|
|
|
|
|
|
+ if len(skus) == 0 {
|
|
|
|
|
+ return detailVo, nil
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if len(commodityAreaIdsString) > 1 {
|
|
|
|
|
+ commodityAreaIdsString = commodityAreaIdsString[1:]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
fmt.Println("=============================>", commodityAreaIdsString)
|
|
fmt.Println("=============================>", commodityAreaIdsString)
|
|
|
//================查询goods========================
|
|
//================查询goods========================
|
|
|
var goods domain.Goods
|
|
var goods domain.Goods
|
|
@@ -74,7 +81,7 @@ A:
|
|
|
//=================查询goods_CommodityArea========================
|
|
//=================查询goods_CommodityArea========================
|
|
|
var goodsCommodityArea domain.GoodsCommodityArea
|
|
var goodsCommodityArea domain.GoodsCommodityArea
|
|
|
rows, err = configs.Engine.Table("goods_commodity_area").
|
|
rows, err = configs.Engine.Table("goods_commodity_area").
|
|
|
- Where(" FIND_IN_SET(goods_commodity_area.id,?) and goods_id = ?", commodityAreaIdsString, goods.Id).
|
|
|
|
|
|
|
+ Where(" FIND_IN_SET(goods_commodity_area.id,?)", commodityAreaIdsString).
|
|
|
Rows(&goodsCommodityArea)
|
|
Rows(&goodsCommodityArea)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
println("查询goods_CommodityArea失败", err)
|
|
println("查询goods_CommodityArea失败", err)
|
|
@@ -96,7 +103,9 @@ B:
|
|
|
introductionIds = append(introductionIds, goodsCommodityArea.DetailIntroductionId)
|
|
introductionIds = append(introductionIds, goodsCommodityArea.DetailIntroductionId)
|
|
|
introductionIdString = fmt.Sprint(introductionIdString, ",", goodsCommodityArea.DetailIntroductionId)
|
|
introductionIdString = fmt.Sprint(introductionIdString, ",", goodsCommodityArea.DetailIntroductionId)
|
|
|
}
|
|
}
|
|
|
- introductionIdString = introductionIdString[1:]
|
|
|
|
|
|
|
+ if len(introductionIdString) > 1 {
|
|
|
|
|
+ introductionIdString = introductionIdString[1:]
|
|
|
|
|
+ }
|
|
|
fmt.Println("=============================>", introductionIdString)
|
|
fmt.Println("=============================>", introductionIdString)
|
|
|
//=================查询goods_introduction========================
|
|
//=================查询goods_introduction========================
|
|
|
var goodsIntroduction domain.GoodsIntroduction
|
|
var goodsIntroduction domain.GoodsIntroduction
|