fix: goods100

master
howell 4 years ago
parent e90bfade27
commit bcac26ee9b

@ -61,7 +61,7 @@ func QueryRecommendList(c *gin.Context) {
return
}
var goodsIdList []uint
dbc.DB.Table((&recommendedlist.RecookCommendList{}).TableName()).Where("status=?", p.Status).Pluck("goods_id", &goodsIdList)
mysql.Db.Table((&recommendedlist.RecookCommendList{}).TableName()).Where("status=?", p.Status).Pluck("goods_id", &goodsIdList)
list := make([]QueryCategoryGoodsListResp, 0, 0)
if len(goodsIdList) > 0 {
var goodsList []goods.Information

@ -323,7 +323,8 @@ func QueryPromotionGoodsList(c *gin.Context) {
}
var goodsSkuVolume goods.Sku
dbc.DB.Select("SUM(sales_volume) AS sales_volume, SUM(sales_volume_inc) AS sales_volume_inc,inventory").First(&goodsSkuVolume, "goods_id = ?", v.GoodsID)
dbc.DB.Select("SUM(sales_volume) AS sales_volume, SUM(sales_volume_inc) AS sales_volume_inc,SUM(inventory) AS inventory").
Find(&goodsSkuVolume, "goods_id = ?", v.GoodsID)
salesVolume1 := int(goodsSkuVolume.SalesVolume) + int(goodsSkuVolume.SalesVolumeInc)
fmt.Println(v.ID)

Loading…
Cancel
Save