@ -404,8 +404,10 @@ func GetGoodsRespByInfoList(goodsList []goods.Information, userID uint) []QueryC
"MIN(original_price) AS original_price, " +
"MIN(discount_price) AS discount_price, " +
"MIN(commission) AS commission," +
"MIN(coupon) AS coupon" ) . Group ( "goods_id" ) .
First ( & sku , "goods_id = ?" , v . ID )
"MIN(coupon) AS coupon" ) .
Where ( "goods_id = ?" , v . ID ) .
Group ( "goods_id" ) .
First ( & sku )
//var inventory uint
//var percent uint
@ -424,7 +426,8 @@ func GetGoodsRespByInfoList(goodsList []goods.Information, userID uint) []QueryC
if promotionGoods . ID > 0 {
var promotionSku promotion . Sku
dbc . DB . Select ( "SUM(inventory) AS inventory, SUM(sales_volume) AS sales_volume, MIN(discount_price) as discount_price , MIN(commission) as commission" ) .
Group ( "promotion_goods_id" ) . First ( & promotionSku , "promotion_goods_id = ?" , promotionGoods . ID )
Where ( "promotion_goods_id = ?" , promotionGoods . ID ) .
Group ( "promotion_goods_id" ) . First ( & promotionSku )
discountPrice = promotionSku . DiscountPrice //活动的价格
//commission = promotionSku.Commission //活动的佣金