|
@ -72,7 +72,7 @@ type OrderGoodNum struct { |
|
|
func GetSubOrderGoodNumByGoodIds(goodIds interface{}) (res []*OrderGoodNum, err error) { |
|
|
func GetSubOrderGoodNumByGoodIds(goodIds interface{}) (res []*OrderGoodNum, err error) { |
|
|
err = core.GetXormAuto().Table(&CustomerOrderSub{}).Alias("s").Select("s.goods_id, SUM(s.goods_num) as goods_num"). |
|
|
err = core.GetXormAuto().Table(&CustomerOrderSub{}).Alias("s").Select("s.goods_id, SUM(s.goods_num) as goods_num"). |
|
|
Join("left", (&CustomerOrder{}).TableName()+" as o", "o.id=s.order_id"). |
|
|
Join("left", (&CustomerOrder{}).TableName()+" as o", "o.id=s.order_id"). |
|
|
Where("o.is_delete=0 and s.is_delete=0").In("s.goods_id", goodIds). |
|
|
|
|
|
|
|
|
Where("o.is_delete=0 and s.is_delete=0 and o.type=0").In("s.goods_id", goodIds). |
|
|
NotIn("o.status", "0", "8", "9").Find(&res) |
|
|
NotIn("o.status", "0", "8", "9").Find(&res) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |