|
|
@@ -29,6 +29,7 @@ func GetMallGoodsList(c *gin.Context, req *md.MallGoodsListReq) (interface{}, in |
|
|
|
var goods md.MallGoodListResp |
|
|
|
goods.GoodsId = item["goods_id"] |
|
|
|
goods.SaleState = utils.StrToInt(item["sale_state"]) |
|
|
|
goods.Sales = utils.StrToInt(item["sales"]) |
|
|
|
goods.CreateAt = item["create_at"] |
|
|
|
|
|
|
|
// 商品主图 |
|
|
@@ -46,6 +47,16 @@ func GetMallGoodsList(c *gin.Context, req *md.MallGoodsListReq) (interface{}, in |
|
|
|
goods.UpdateAt = item["update_at"] |
|
|
|
goods.Title = item["title"] |
|
|
|
|
|
|
|
// 状态 |
|
|
|
switch utils.StrToInt64(item["sale_state"]) { |
|
|
|
case 1.00: |
|
|
|
goods.SaleStateText = "銷售中" |
|
|
|
break |
|
|
|
case 2.00: |
|
|
|
goods.SaleStateText = "下架" |
|
|
|
break |
|
|
|
} |
|
|
|
|
|
|
|
// sku |
|
|
|
for _, skuItem := range skus { |
|
|
|
if skuItem.GoodsId == utils.StrToInt64(item["goods_id"]) { |
|
|
|