master
howell 3 years ago
parent b82d454e77
commit 2709c6d332

@ -380,7 +380,7 @@ func GetGoodsRespBySkuList(skuList []goods.Sku, uid uint) []QueryCategoryGoodsLi
commission = commission1.Add(commission2).Add(commission3)
if u.Level == 10 {
commission = v.DiscountPrice.Sub(v.GetSalePrice(u.Level)).Mul(decimal.NewFromFloat(define.Coefficient))
commission = v.DiscountPrice.Sub(v.PurchasePrice.Mul(decimal.NewFromFloat(1.03))).Mul(decimal.NewFromFloat(define.Coefficient)).Round(2)
}
recookGoodsInfoModel := &goods2.RecookGoodsInfoModel{}

@ -142,9 +142,10 @@ type momentsCopyResponse struct {
}
type salesInventory struct {
Inventory uint `gorm:"column:inventory" json:"inventory"`
SalesVolume uint `gorm:"column:sales_volume" json:"salesVolume"`
SaleInventory uint `gorm:"column:sale_inventory" json:"sale_inventory"`
Inventory uint `gorm:"column:inventory" json:"inventory"`
SalesVolume uint `gorm:"column:sales_volume" json:"salesVolume"`
SaleInventory uint `gorm:"column:sale_inventory" json:"sale_inventory"`
SaleInventoryInc uint `gorm:"column:sale_inventory_inc" json:"sale_inventory_inc"`
}
type Goods struct {
@ -317,9 +318,9 @@ func QueryGoodsDetailNew(c *gin.Context) {
dbc.DB.Table((&goods.Information{}).TableName()).First(&summary, p.GoodsID)
var sv salesInventory
dbc.DB.Table((&goods.Sku{}).TableName()).Select("SUM(inventory) AS inventory, SUM(sales_volume) AS sales_volume, SUM(sale_inventory) AS sale_inventory").
dbc.DB.Table((&goods.Sku{}).TableName()).Select("SUM(inventory) AS inventory, SUM(sales_volume) AS sales_volume, SUM(sales_volume_inc) AS sales_volume_inc,SUM(sale_inventory) AS sale_inventory").
First(&sv, "goods_id = ?", p.GoodsID)
summary.SalesVolume = sv.SalesVolume
summary.SalesVolume = sv.SalesVolume + sv.SaleInventoryInc
summary.Inventory = sv.Inventory
summary.SaleInventory = sv.SaleInventory

Loading…
Cancel
Save