Commit d689bf08 by 杨树贤

获取成本价给自营订单

parent a4072b89
...@@ -95,6 +95,8 @@ type LySku struct { ...@@ -95,6 +95,8 @@ type LySku struct {
BrandPack string `json:"brand_pack"` BrandPack string `json:"brand_pack"`
OnwayStock int `json:"onway_stock"` OnwayStock int `json:"onway_stock"`
CompareRatio float64 `json:"compare_ratio"` CompareRatio float64 `json:"compare_ratio"`
//兼容自营下单的字段,取成本价的第一个阶梯的人民币
Cost float64 `json:"cost"`
} }
type DiscountRatio struct { type DiscountRatio struct {
......
...@@ -267,6 +267,8 @@ func (ls *LyService) LyGoodsDetail(ctx context.Context, params RequestParams, go ...@@ -267,6 +267,8 @@ func (ls *LyService) LyGoodsDetail(ctx context.Context, params RequestParams, go
// sku = priceService.GetComparePrice(sku) // sku = priceService.GetComparePrice(sku)
sku = priceService.GetCostForZiying(sku)
//仅提供价格和库存 //仅提供价格和库存
if fast != "1" { if fast != "1" {
if sku.SupplierId != 0 { if sku.SupplierId != 0 {
......
...@@ -921,7 +921,7 @@ func (ps *PriceService) GetActivityPrice(sku model.LySku) model.LySku { ...@@ -921,7 +921,7 @@ func (ps *PriceService) GetActivityPrice(sku model.LySku) model.LySku {
} }
// compare_price_ratio // compare_price_ratio
func (ps *PriceService) GetCompar1ePrice(sku model.LySku) model.LySku { func (ps *PriceService) GetComparePrice(sku model.LySku) model.LySku {
redisCon := gredis.Conn("default_r") redisCon := gredis.Conn("default_r")
//判断是否存在 //判断是否存在
compareData, _ := redis.String(redisCon.Do("HGET", "compare_price_ratio", sku.GoodsId)) compareData, _ := redis.String(redisCon.Do("HGET", "compare_price_ratio", sku.GoodsId))
...@@ -945,3 +945,12 @@ func (ps *PriceService) GetCompar1ePrice(sku model.LySku) model.LySku { ...@@ -945,3 +945,12 @@ func (ps *PriceService) GetCompar1ePrice(sku model.LySku) model.LySku {
sku.LadderPriceResult = sku.LadderPrice sku.LadderPriceResult = sku.LadderPrice
return sku return sku
} }
// 获取自营成本价
func (ps *PriceService) GetCostForZiying(sku model.LySku) model.LySku {
if len(sku.OriginalPrice) != 0 {
sku.Cost = sku.OriginalPrice[0].PriceCn
}
return sku
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment